Send stuck stories to Slack


How to apply this rule?



Warning: sample URLs!

Please make sure to replace with your Slack Webhook URL and with your Targetprocess URL

Filter by is optional.

    "type": "source:schedule",
    "schedule": {
      "kind": "interval",
      "unit": "hour",
      "value": 24
    "type": "action:JavaScript",
    "script": "const api = context.getService(\"targetprocess/api/v2\");\nconst stories = await api.queryAsync(\"UserStories\", {\n  select: \"{id, name}\",\n  where: ` and LastStateChangeDate <= Today.AddDays(-14) and endDate == null`\n});\n\nconst links = => {\n  return `<${args.accountBaseUrl}${}|${}>`;\n});\n\n//IMPORTANT: Update Slack link below\nreturn {\n  command: \"SendHttpRequest\",\n  payload: {\n    url: \"\",\n    body: {\n      text: `Stuck stories:\\n ${links.join('\\n')}`,\n      username: \"TP\",\n      icon_emoji: \":bangbang:\"\n    }\n  }\n};"