Mismatch between documentation and actual payload for jira forge issue updated product event

XMLWordPrintable

    • Severity 3 - Minor
    • Warranty
    • S

      Issue Summary

      Using one of those 2 api's
      https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-values--apps-/#api-rest-api-3-app-field-value-post
      https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-values--apps-/#api-rest-api-3-app-field-fieldidorkey-value-put
      with generateChangelog parameter set to false results in forge product event payload inconsistent with documentation.
      (There might be other corner cases/apis that trigger this behaviour)

      This is reproducible on Data Center: (no)

      Steps to Reproduce

      1. register handler for issue updated event https://developer.atlassian.com/platform/forge/events-reference/jira/#issue-updated
        - key: debug-events-handler
              function: main
              events:
                - avi:jira:updated:issue
          function:
            - key: main
              handler: index.debugIt
        

      #define some custom field

        jira:customField:
          - key: cf-forge-string
            name: Forge string
            description: Forge string description
            type: string
      
      1. log the event output in the handler eg
        export async function debugIt(event, context) {
        	console.log('event: ', JSON.stringify(event), "context: ", JSON.stringify(context));
        }
        

      Use one of the following api's from the forge app (you can use webtriggers, registering custom)
      https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-values--apps-/#api-rest-api-3-app-field-value-post
      https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-values--apps-/#api-rest-api-3-app-field-fieldidorkey-value-put
      with "generateChangelog" parameter set to false

      1. observe in the developer console the output of the handler

      Expected Results

      According to the docs https://developer.atlassian.com/platform/forge/events-reference/jira/#issue-updated changelog field is mandatory

      Actual Results

      changelog field is missing from the payload

      {
          "issue": {
              "id": "11057",
              "key": "WCEP-10",
              "fields": {
                  "summary": "test",
                  "issuetype": {
                      "self": "https://api.stg.atlassian.com/ex/jira/*************/rest/api/3/issuetype/10005",
                      "id": "10005",
                      "description": "A small, distinct piece of work.",
                      "iconUrl": "https://api.stg.atlassian.com/ex/jira/*************/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium",
                      "name": "Task",
                      "subtask": false,
                      "avatarId": 10318,
                      "hierarchyLevel": 0
                  },
                  "creator": {
                      "accountId": "*************"
                  },
                  "created": "2024-11-04T13:13:37.815+0100",
                  "project": {
                      "self": "https://api.stg.atlassian.com/ex/jira/*************/rest/api/3/project/10014",
                      "id": "10014",
                      "key": "WCEP",
                      "name": "WCEP",
                      "projectTypeKey": "software",
                      "simplified": false,
                      "avatarUrls": {...}
                  },
                  "reporter": {
                      "accountId": "*************"
                  },
                  "assignee": null,
                  "updated": "2024-11-04T14:31:56.448+0100",
                  "status": {
                      "self": "https://api.stg.atlassian.com/ex/jira/*************/rest/api/3/status/10003",
                      "description": "",
                      "iconUrl": "https://api.stg.atlassian.com/ex/jira/*************/",
                      "name": "To Do",
                      "id": "10003",
                      "statusCategory": {
                          "self": "https://api.stg.atlassian.com/ex/jira/*************/rest/api/3/statuscategory/2",
                          "id": 2,
                          "key": "new",
                          "colorName": "blue-gray",
                          "name": "To Do"
                      }
                  }
              }
          },
          "atlassianId": "*************",
          "associatedUsers": [
              {
                  "accountId": "*************"
              }
          ],
          "eventType": "avi:jira:updated:issue"
      }
      

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

            Assignee:
            Unassigned
            Reporter:
            Tomasz Kanafa
            Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: