Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

Here is an example of an Automation for adding the issue key with a hashtag to work logs synchronized to MOCO with advanced synchronization.image-20240710-084325.pngImage Removed

...

  1. Trigger: Work was logged

  2. If-else condition

  3. If the comment in the work log already starts with a hashtag, nothing will happen. Only the comment of the work log is logged.

  4. Else, a {{smart values}} condition:

    1. First value: {{worklog.comment}}

    2. Condition: does not match regular expression

    3. Regular expression: ^#.*$

  5. A web request is executed that updates the work log (https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/#api-rest-api-3-issue-issueidorkey-worklog-id-put )

    1. URL: {{baseUrl}}/rest/api/3/issue/{{issue.key}}/worklog/{{worklog.id}}

    2. HTTP-Method: PUT

    3. Web request body: Custom data

    4. Custom data:

      Codeblock
      {
        "comment": {
          "content": [
            {
              "content": [
                {
                  "text": "#{{issue.key}} {{worklog.comment}}",
                  "type": "text"
                }
              ],
              "type": "paragraph"
            }
          ],
          "type": "doc",
          "version": 1
        }
      }
    5. Header

...

With this Automation, every time work is logged, the issue key with a hashtag is added to the comment at the beginning if it does not already start with a hashtag.

Hinweis

If duplicate time logs are transferred to MOCO, it may be because the work log created in Jira has not yet been registered for MOCO when the trigger is executed in the automation. Technically, this means that the work log property has not yet been set by the plugin and therefore a new time log is sent to MOCO during the update.

The solution is to wait until this worklog property has been set by the plugin. There is currently a ticket at Atlassian for the support of delays in the execution of automation rules (AUTO-238).

Until this is implemented, the "Re-fetch issue data" action can be inserted several times after the trigger as an alternative:

image-20240716-100017.pngImage Added