mattermost-plugin-jira: Unsupported webhook data: jira:issue_updated

After we upgraded our mattermost server to version 5.13.2 we’re experiencing issues with our Jira integration via the webhook method.

Currently our Jira WebHook setup looks like this:

Image Pasted at 2019-8-8 14-54

Before the upgrade we were notified about opened and closed issues in the respective channel. After the update we only get notifications for opened issues. If someone closes a task in Jira we also see the following error message in our mattermost server log:

{"level":"error","ts":1565268360.034311,"caller":"mlog/sugar.go:23","msg":"ERROR: ","plugin_id":"jira","Status":"400","Error":"Unsupported webhook data: jira:issue_updated","Host":"<URL>","RequestURI":"/plugins/jira/webhook?secret=<SECRET>&team=<TEAM>&channel=<CHANNEL>&updated_status=1&user_id=<USERID>&user_key=<USERID>","Method":"POST","query":"channel=<USERID>&secret=<SECRET>&team=<TEAM>&updated_status=1&user_id=<USERID>&user_key=<USERID>"}

Is there any possibility to see which field or part of the posted content is causing this error?

Regards,

Daniel

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

@danielhass My read, based on that payload, is that this will probably worked with the Jira plugin prior to version 2 and should work again starting with version 2.1, which is included with Mattermost 5.14.0.

On my end, I’m seeing this issue as a result of my version of Jira not including the issue_event_type_name field, which the plugin relies on for processing. I’m trying to push through an upgrade, but that’ll take some time. In the meantime, it would be nice if the plugin could process webhook payloads that don’t include it.

@mickmister - sorry that it took me that long to answer. Jira Server 7.11.2.

Please find the POST with attached body of an issue_closed event below (private information omitted):

POST /plugins/jira/webhook?secret=<secret>&updated_status=1&team=adabas&channel=gtd-adabas&user_id=<user_id>&user_key=<user_id>

{
    "timestamp": 1566208563663,
    "webhookEvent": "jira:issue_updated",
    "issue_event_type_name": "issue_closed",
    "user": {
        "self": "https://<jira-url>/rest/api/2/user?username=<user-id>",
        "name": "<user-id>",
        "key": "<user-id>",
        "emailAddress": "<email>",
        "avatarUrls": {
            "48x48": "https://<jira-url>/secure/useravatar?ownerId=<user-id>&avatarId=14969",
            "24x24": "https://<jira-url>/secure/useravatar?size=small&ownerId=<user-id>&avatarId=14969",
            "16x16": "https://<jira-url>/secure/useravatar?size=xsmall&ownerId=<user-id>&avatarId=14969",
            "32x32": "https://<jira-url>/secure/useravatar?size=medium&ownerId=<user-id>&avatarId=14969"
        },
        "displayName": "<display-name>",
        "active": true,
        "timeZone": "Europe/Berlin"
    },
    "issue": {
        "id": "90792",
        "self": "https://<jira-url>/rest/api/2/issue/90792",
        "key": "ADABAS-2461",
        "fields": {
            "fixVersions": [],
            "resolution": {
                "self": "https://<jira-url>/rest/api/2/resolution/1",
                "id": "1",
                "description": "A fix for this issue is checked into the tree and tested.",
                "name": "Fixed"
            },
            "lastViewed": "2019-08-19T11:56:03.652+0200",
            "priority": {
                "self": "https://<jira-url>/rest/api/2/priority/4",
                "iconUrl": "https://<jira-url>/images/icons/priorities/minor.svg",
                "name": "Minor",
                "id": "4"
            },
            "labels": [],
            "aggregatetimeoriginalestimate": null,
            "timeestimate": null,
            "versions": [],
            "issuelinks": [],
            "assignee": {
                "self": "https://<jira-url>/rest/api/2/user?username=<user-id>",
                "name": "<user-id>",
                "key": "<user-id>",
                "emailAddress": "<email>",
                "avatarUrls": {
                    "48x48": "https://<jira-url>/secure/useravatar?ownerId=<user-id>&avatarId=14969",
                    "24x24": "https://<jira-url>/secure/useravatar?size=small&ownerId=<user-id>&avatarId=14969",
                    "16x16": "https://<jira-url>/secure/useravatar?size=xsmall&ownerId=<user-id>&avatarId=14969",
                    "32x32": "https://<jira-url>/secure/useravatar?size=medium&ownerId=<user-id>&avatarId=14969"
                },
                "displayName": "<display-name>",
                "active": true,
                "timeZone": "Europe/Berlin"
            },
            "status": {
                "self": "https://<jira-url>/rest/api/2/status/6",
                "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.",
                "iconUrl": "https://<jira-url>/images/icons/statuses/closed.png",
                "name": "Closed",
                "id": "6",
                "statusCategory": {
                    "self": "https://<jira-url>/rest/api/2/statuscategory/3",
                    "id": 3,
                    "key": "done",
                    "colorName": "green",
                    "name": "Done"
                }
            },
            "components": [],
            "aggregatetimeestimate": null,
            "creator": {
                "self": "https://<jira-url>/rest/api/2/user?username=<user-id>",
                "name": "<user-id>",
                "key": "<user-id>",
                "emailAddress": "<email>",
                "avatarUrls": {
                    "48x48": "https://<jira-url>/secure/useravatar?ownerId=<user-id>&avatarId=14969",
                    "24x24": "https://<jira-url>/secure/useravatar?size=small&ownerId=<user-id>&avatarId=14969",
                    "16x16": "https://<jira-url>/secure/useravatar?size=xsmall&ownerId=<user-id>&avatarId=14969",
                    "32x32": "https://<jira-url>/secure/useravatar?size=medium&ownerId=<user-id>&avatarId=14969"
                },
                "displayName": "<display-name>",
                "active": true,
                "timeZone": "Europe/Berlin"
            },
            "subtasks": [],
            "reporter": {
                "self": "https://<jira-url>/rest/api/2/user?username=<user-id>",
                "name": "<user-id>",
                "key": "<user-id>",
                "emailAddress": "<email>",
                "avatarUrls": {
                    "48x48": "https://<jira-url>/secure/useravatar?ownerId=<user-id>&avatarId=14969",
                    "24x24": "https://<jira-url>/secure/useravatar?size=small&ownerId=<user-id>&avatarId=14969",
                    "16x16": "https://<jira-url>/secure/useravatar?size=xsmall&ownerId=<user-id>&avatarId=14969",
                    "32x32": "https://<jira-url>/secure/useravatar?size=medium&ownerId=<user-id>&avatarId=14969"
                },
                "displayName": "<display-name>",
                "active": true,
                "timeZone": "Europe/Berlin"
            },
            "aggregateprogress": {
                "progress": 0,
                "total": 0
            },
            "progress": {
                "progress": 0,
                "total": 0
            },
            "votes": {
                "self": "https://<jira-url>/rest/api/2/issue/ADABAS-2461/votes",
                "votes": 0,
                "hasVoted": false
            },
            "worklog": {
                "startAt": 0,
                "maxResults": 20,
                "total": 0,
                "worklogs": []
            },
            "issuetype": {
                "self": "https://<jira-url>/rest/api/2/issuetype/3",
                "id": "3",
                "description": "A task that needs to be done.",
                "iconUrl": "https://<jira-url>/secure/viewavatar?size=xsmall&avatarId=11518&avatarType=issuetype",
                "name": "Task",
                "subtask": false,
                "avatarId": 11518
            },
            "timespent": null,
            "project": {
                "self": "https://<jira-url>/rest/api/2/project/13408",
                "id": "13408",
                "key": "ADABAS",
                "name": "Applications and Databases",
                "avatarUrls": {
                    "48x48": "https://<jira-url>/secure/projectavatar?pid=13408&avatarId=10009",
                    "24x24": "https://<jira-url>/secure/projectavatar?size=small&pid=13408&avatarId=10009",
                    "16x16": "https://<jira-url>/secure/projectavatar?size=xsmall&pid=13408&avatarId=10009",
                    "32x32": "https://<jira-url>/secure/projectavatar?size=medium&pid=13408&avatarId=10009"
                },
                "projectCategory": {
                    "self": "https://<jira-url>/rest/api/2/projectCategory/10301",
                    "id": "10301",
                    "description": "",
                    "name": "InfoServe"
                }
            },
            "aggregatetimespent": null,
            "resolutiondate": "2019-08-19T11:56:03.655+0200",
            "workratio": -1,
            "watches": {
                "self": "https://<jira-url>/rest/api/2/issue/ADABAS-2461/watchers",
                "watchCount": 0,
                "isWatching": false
            },
            "created": "2019-08-19T11:55:57.612+0200",
            "updated": "2019-08-19T11:56:03.661+0200",
            "timeoriginalestimate": null,
            "description": "Test",
            "timetracking": {},
            "attachment": [],
            "summary": "Test 2",
            "environment": null,
            "duedate": null,
            "comment": {
                "comments": [],
                "maxResults": 0,
                "total": 0,
                "startAt": 0
            }
        }
    },
    "changelog": {
        "id": "479172",
        "items": [{
            "field": "resolution",
            "fieldtype": "jira",
            "from": null,
            "fromString": null,
            "to": "1",
            "toString": "Fixed"
        }, {
            "field": "status",
            "fieldtype": "jira",
            "from": "11818",
            "fromString": "Unplanned",
            "to": "6",
            "toString": "Closed"
        }]
    }
}