Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported webhook data: jira:issue_updated #272

Open
danielhass opened this issue Aug 8, 2019 · 9 comments

Comments

@danielhass
Copy link

commented Aug 8, 2019

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

@joewaitye

This comment has been minimized.

Copy link

commented Aug 9, 2019

I have seen a similar situation as well. For my case, it is not only affecting closing an issue, but also other transitions such as moving it into 'In Progress' or 'Reopened', which should work in version 2 of the plugin.

I am seeing the same error message as Daniel in the Server Logs.

@grubbins

This comment has been minimized.

Copy link

commented Aug 9, 2019

Same behaviour here with Jira server v7.8.4 and mattermost 5.13.2. Posts do appear in the channel when a ticket is assigned, but that's all.

@razbag

This comment has been minimized.

Copy link

commented Aug 9, 2019

Same Issue when I try to Resolve/close/update the issue

{"level":"error","ts":1565379735.9022,"caller":"mlog/sugar.go:23","msg":"ERROR: ","plugin_id":"jira","Status":"400","Error":"Unsupported webhook data: jira:issue_updated"

MM version is 5.13.2 on 5.5.0 it is worked properly

Thanks
Razmik

@razbag

This comment has been minimized.

Copy link

commented Aug 9, 2019

Same issue with plugin v2.1.0_rc2

@mickmister

This comment has been minimized.

Copy link
Member

commented Aug 13, 2019

Hi @danielhass, @joewaitye, @grubbins, and @razbag

Would either of you four be willing to supply a webhook payload being sent from Jira that is causing this error (with info redacted)? I can help capture if needed.

Could you also share if you are experiencing this on Jira Server or Jira Cloud?

Thanks!
Michael

@grubbins

This comment has been minimized.

Copy link

commented Aug 13, 2019

I mentioned before that it is on Jira server v7.8.4 in my case.

I will try to capture a payload when I have a moment!

@mickmister

This comment has been minimized.

Copy link
Member

commented Aug 13, 2019

@grubbins

Thank you for letting me know, sorry about that.

I will try to capture a payload when I have a moment!

Great, thank you very much!

@danielhass

This comment has been minimized.

Copy link
Author

commented Aug 19, 2019

@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"
        }]
    }
}
@elyscape

This comment has been minimized.

Copy link

commented Aug 20, 2019

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.