Details
-
Suggestion
-
Resolution: Low Engagement
-
0
-
9
-
Description
NOTE: This suggestion is for JIRA Cloud. Using JIRA Server? See the corresponding suggestion.
Problem Definition
It is currently not possible to restrict the JSON data which will be posted by the JIRA Webhook.
For example, a standard Webhook response for an issue may look as follows:
{ "webhookEvent": "jira:issue_created", "user": { "self": "http:\/\/localhost:6314\/j6314\/rest\/api\/2\/user?username=admin", "name": "admin", "emailAddress": "admin@example.com", "avatarUrls": { "16x16": "http:\/\/localhost:6314\/j6314\/secure\/useravatar?size=xsmall&avatarId=10122", "24x24": "http:\/\/localhost:6314\/j6314\/secure\/useravatar?size=small&avatarId=10122", "32x32": "http:\/\/localhost:6314\/j6314\/secure\/useravatar?size=medium&avatarId=10122", "48x48": "http:\/\/localhost:6314\/j6314\/secure\/useravatar?avatarId=10122" }, "displayName": "Admin [Local]", "active": true }, "issue": { "id": "10301", "self": "http:\/\/localhost:6314\/j6314\/rest\/api\/2\/issue\/10301", "key": "SW-2", "fields": { "progress": { "progress": 0, "total": 0 }, "summary": "qwe", "timetracking": { }, "issuetype": { "self": "http:\/\/localhost:6314\/j6314\/rest\/api\/2\/issuetype\/1", "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "iconUrl": "http:\/\/localhost:6314\/j6314\/images\/icons\/issuetypes\/bug.png", "name": "Bug", "subtask": false }, "votes": { "self": "http:\/\/localhost:6314\/j6314\/rest\/api\/2\/issue\/SW-2\/votes", "votes": 0, "hasVoted": false }, "resolution": null, "fixVersions": [ ], "resolutiondate": null, "timespent": null, "creator": { "self": "http:\/\/localhost:6314\/j6314\/rest\/api\/2\/user?username=admin", "name": "admin", "emailAddress": "admin@example.com", "avatarUrls": { "16x16": "http:\/\/localhost:6314\/j6314\/secure\/useravatar?size=xsmall&avatarId=10122", "24x24": "http:\/\/localhost:6314\/j6314\/secure\/useravatar?size=small&avatarId=10122", "32x32": "http:\/\/localhost:6314\/j6314\/secure\/useravatar?size=medium&avatarId=10122", "48x48": "http:\/\/localhost:6314\/j6314\/secure\/useravatar?avatarId=10122" }, "displayName": "Admin [Local]", "active": true }, "reporter": { "self": "http:\/\/localhost:6314\/j6314\/rest\/api\/2\/user?username=admin", "name": "admin", "emailAddress": "admin@example.com", "avatarUrls": { "16x16": "http:\/\/localhost:6314\/j6314\/secure\/useravatar?size=xsmall&avatarId=10122", "24x24": "http:\/\/localhost:6314\/j6314\/secure\/useravatar?size=small&avatarId=10122", "32x32": "http:\/\/localhost:6314\/j6314\/secure\/useravatar?size=medium&avatarId=10122", "48x48": "http:\/\/localhost:6314\/j6314\/secure\/useravatar?avatarId=10122" }, "displayName": "Admin [Local]", "active": true }, "aggregatetimeoriginalestimate": null, "created": "2015-02-13T09:27:01.008+0800", "updated": "2015-02-13T09:27:01.008+0800", "description": null, "priority": { "self": "http:\/\/localhost:6314\/j6314\/rest\/api\/2\/priority\/3", "iconUrl": "http:\/\/localhost:6314\/j6314\/images\/icons\/priorities\/major.png", "name": "Major", "id": "3" }, "duedate": null, "customfield_10001": null, "issuelinks": [ ], "watches": { "self": "http:\/\/localhost:6314\/j6314\/rest\/api\/2\/issue\/SW-2\/watchers", "watchCount": 0, "isWatching": false }, "worklog": { "startAt": 0, "maxResults": 20, "total": 0, "worklogs": [ ] }, "customfield_10000": "0|i000hb:", "customfield_10102": null, "customfield_10101": [ ], "subtasks": [ ], "customfield_10100": null, "status": { "self": "http:\/\/localhost:6314\/j6314\/rest\/api\/2\/status\/1", "description": "The issue is open and ready for the assignee to start work on it.", "iconUrl": "http:\/\/localhost:6314\/j6314\/images\/icons\/statuses\/open.png", "name": "Open", "id": "1", "statusCategory": { "self": "http:\/\/localhost:6314\/j6314\/rest\/api\/2\/statuscategory\/2", "id": 2, "key": "new", "colorName": "blue-gray", "name": "New" } }, "customfield_10007": null, "customfield_10006": null, "labels": [ ], "customfield_10005": null, "workratio": -1, "assignee": null, "attachment": [ ], "aggregatetimeestimate": null, "project": { "self": "http:\/\/localhost:6314\/j6314\/rest\/api\/2\/project\/10200", "id": "10200", "key": "SW", "name": "Screwed workflow", "avatarUrls": { "16x16": "http:\/\/localhost:6314\/j6314\/secure\/projectavatar?size=xsmall&pid=10200&avatarId=10011", "24x24": "http:\/\/localhost:6314\/j6314\/secure\/projectavatar?size=small&pid=10200&avatarId=10011", "32x32": "http:\/\/localhost:6314\/j6314\/secure\/projectavatar?size=medium&pid=10200&avatarId=10011", "48x48": "http:\/\/localhost:6314\/j6314\/secure\/projectavatar?pid=10200&avatarId=10011" } }, "versions": [ ], "environment": null, "timeestimate": null, "aggregateprogress": { "progress": 0, "total": 0 }, "lastViewed": null, "components": [ ], "comment": { "startAt": 0, "maxResults": 0, "total": 0, "comments": [ ] }, "timeoriginalestimate": null, "aggregatetimespent": null } }, "timestamp": 1423790821028 }
Suggested Solution
As JIRA administrator, I would like to be able to configure which fields are included in the JSON WebHook response (e.g. post only the "Issue Key", "Summary" & "Status" to the destination URL when using WebHooks).
Workaround
You can use an automation rule using the "send web request" action with custom payload, as described in below links:
- https://confluence.atlassian.com/jirakb/how-to-extend-automation-for-jira-with-rest-api-calls-1021217952.html
- https://community.atlassian.com/t5/Jira-discussions/Jira-Automation-Rules-Send-Web-Request-and-APIs-protected-by/td-p/1568456
- https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828
Attachments
Issue Links
- is related to
-
JRASERVER-42045 As a JIRA Application Administrator, I would like to be able to configure the information sent via Webhooks
- Gathering Interest