How to use Jira Webhook?

Description

I’m trying to setup the Jira integration as described here. I’m using the script linked on the page from GitHub.
I want to post in the private group #rocket.chat_debug and also tried with #general.

When running the curl command, there’s no failure in the logs, but also no message in the channel #rocket.chat_debug.

In the Jira logs, there is a warning:

2020-09-28 13:08:58,758 httpclient-callbacks:thread-8 WARN anonymous [c.a.webhooks.plugin.PublishTaskFactoryImpl$PublishTaskImpl] Client error - 400 when posting to web hook at ‘https://rocketchat-server/hooks/F23u4CY7wrQMnekzj/vGNMrbYKuBMepqa7ec7xYN7qiDxptbNiNzwuSGDCWDRywq32

Anyone here who has successfully set up this Webhook? The script is quite old, maybe it doesn’t work anymore and isn’t processing the data from Jira correctly!?

Server Setup Information

  • Version of Rocket.Chat Server: 3.6.3
  • Operating System: Debian
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: enabled
  • NodeJS Version: 12.16.1
  • MongoDB Version: 4.0.16
  • Proxy: Citrix ADC
  • Firewalls involved: -

Any additional Information

This is what I get in the RC logs, when using the curl statement from the integration page:

I20200928-11:04:29.903(0) server.js:204 API ➔ debug POST: /hooks/F23u4CY7wrQMnekzj/vGNMrbYKuBMepqa7ec7xYN7qiDxptbNiNzwuSGDCWDRywq32
I20200928-11:04:29.904(0) server.js:204 Integrations ➔ Incoming WebHook.info Post integration: gpmuser
I20200928-11:04:29.905(0) server.js:204 Integrations ➔ Incoming WebHook.debug @urlParams: { integrationId: ‘F23u4CY7wrQMnekzj’, token: ‘vGNMrbYKuBMepqa7ec7xYN7qiDxptbNiNzwuSGDCWDRywq32’ }
I20200928-11:04:29.906(0) server.js:204 Integrations ➔ Incoming WebHook.debug @bodyParams: { text: ‘Test mit curl’, attachments: [ { title: ‘Rocket.Chat’, title_link: ‘https://rocket.chat’, text: ‘Rocket.Chat, the best open source chat’, image_url: ‘/images/integration-attachment-example.png’, color: ‘#764FA5’ } ] }
I20200928-11:04:29.913(0) server.js:204 Integrations ➔ Incoming WebHook.debug [Process Incoming Request result of Trigger gpmuser :] No data
I20200928-11:04:29.914(0) server.js:204 API ➔ debug Success { statusCode: 200, body: { success: true } }

This is what I get in the RC logs, when triggering the webhook from Jira:

I20200928-11:08:23.521(0) server.js:204 API ➔ debug GET: /api/v1/integrations.list?query={%22name%22:{%22$regex%22:%22%22,%22$options%22:%22i%22}}&sort={%22name%22:1}&count=25

[…]

I20200928-11:08:30.303(0) server.js:204 API ➔ debug GET: /api/v1/integrations.get?integrationId=F23u4CY7wrQMnekzj
I20200928-11:08:30.308(0) server.js:204 API ➔ debug Success { statusCode: 200, body: { integration: { _id: ‘F23u4CY7wrQMnekzj’, enabled: true, channel: [Array], username: ‘rc.user’, name: ‘gpmuser’, alias: ‘’, avatarUrl: ‘’, emoji: ‘’, scriptEnabled: true, script: ‘/jshint esnext:true/
’ + ‘const DESC_MAX_LENGTH = 140;
’ + “const JIRA_LOGO = ‘data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACRElEQVRYhb/jIXDkk+pgAAAABJRU5ErkJggg==’;
” + ‘function stripDesc(str) {
’ + “\treturn (str && str.length > DESC_MAX_LENGTH) ? str.slice(0, DESC_MAX_LENGTH - 3) + ‘…’ : str;
” + ‘}
’ + ‘
’ + ‘function prepareAttachment({issue, user}, text) {
’ + ‘\tlet issueType = issue.fields.issuetype;
’ + ‘\tlet res = {
’ + ‘\t\tauthor_name: user.displayName
’ + “\t\t, author_icon: user.avatarUrls[‘24x24’]
” + ‘\t\t, thumb_url: issueType.iconUrl
’ + ‘\t};
’ + ‘\tif (text) {
’ + “\t\ttext = text.replace(/\{\{(user|issue)\.([^a-z_0-9]+)\}\}/g, (m, type, key) => (type===‘user’ ? user : issue)[key]);
” + ‘\t\tres.text = text;
’ + ‘\t}
’ + ‘\treturn res;
’ + ‘}
’ + ‘class Script {
’ + ‘\tprocess_incoming_request({request}) {
’ + ‘\t\tconst data = request.content;
’ + ‘\t\ttry {
’ + “\t\t\tif (!data.issue || (data.user && data.user.name === ‘gitlab’)) {
” + ‘\t\t\t\treturn;
’ + ‘\t\t\t}
’ + ‘\t\t\tlet issue = data.issue;
’ + “\t\t\tlet baseJiraUrl = issue.self.replace(/\/rest\/./, '');<br>" + '\t\t\tlet user = data.user;<br>' + "\t\t\tlet assignedTo = (issue.fields.assignee && issue.fields.assignee.name !== user.name) ? `, assigned to {issue.fields.assignee.displayName}: '';<br>" + "\t\t\tlet issueSummary =${issue.key} {issue.fields.summary} _({issue.fields.priority.name.replace(/^\s\d*\.\s*/, ‘’)}{assignedTo})_`;<br>" + '\t\t\tlet message = {<br>' + "\t\t\t\ticon_url: (issue.fields.project && issue.fields.project.avatarUrls && issue.fields.project.avatarUrls['48x48']) || JIRA_LOGO<br>" + '\t\t\t\t, attachments: []<br>' + '\t\t\t};<br>' + '<br>' + "\t\t\tif (data.webhookEvent === 'jira:issue_created') {<br>" + '\t\t\t\tmessage.attachments.push(prepareAttachment(data, `*Created* {issueSummary}:<br>{stripDesc(issue.fields.description)}`));<br>' + "\t\t\t} else if (data.webhookEvent === 'jira:issue_deleted') {<br>" + '\t\t\t\tmessage.attachments.push(prepareAttachment(data, `*Deleted* {issueSummary}));<br>' + "\t\t\t} else if (data.webhookEvent === 'jira:issue_updated') {<br>" + '\t\t\t\tif (data.changelog && data.changelog.items) { // field update<br>' + '\t\t\t\t\tlet logs = [];<br>' + '\t\t\t\t\tdata.changelog.items.forEach((change) => {<br>' + "\t\t\t\t\t\tif (!change.field.match('status|resolution|comment|priority') ) {<br>" + '\t\t\t\t\t\t\treturn;<br>' + '\t\t\t\t\t\t}<br>' + "\t\t\t\t\t\tif (change.field==='description') {<br>" + '\t\t\t\t\t\t\tlogs.push(Changed description to:<br>{stripDesc(change.toString)}`);<br>' + '\t\t\t\t\t\t} else {<br>' + '\t\t\t\t\t\t\tlogs.push(`*{change.field}* changed from {change.fromString} to *{change.toString});<br>' + '\t\t\t\t\t\t}<br>' + '\t\t\t\t\t});<br>' + "\t\t\t\t\tlogs.length && message.attachments.push(prepareAttachment(data, Updated {issueSummary}:\<br> - {logs.join(’<br> - ')}));<br>" + '\t\t\t\t}<br>' + '<br>' + '\t\t\t\tif (data.comment) { // comment update<br>' + '\t\t\t\t\tlet comment = data.comment;<br>' + "\t\t\t\t\tlet action = comment.created !== comment.updated ? 'Updated comment' : 'Commented';<br>" + '\t\t\t\t\tmessage.attachments.push(prepareAttachment(data, {action}* on {issueSummary}:<br>{stripDesc(comment.body)}`));<br>' + '\t\t\t\t}<br>' + '\t\t\t}<br>' + '<br>' + '\t\t\tif (message.text || message.attachments.length) {<br>' + '\t\t\t\treturn {content:message};<br>' + '\t\t\t}<br>' + '\t\t} catch(e) {<br>' + "\t\t\tconsole.log('jiraevent error', e);<br>" + '\t\t\treturn {<br>' + '\t\t\t\terror: {<br>' + '\t\t\t\t\tsuccess: false,<br>' + '\t\t\t\t\tmessage: `{e.message || e} {JSON.stringify(data)}`<br>' + '\t\t\t\t}<br>' + '\t\t\t};<br>' + '\t\t}<br>' + '\t}<br>' + '}', type: 'webhook-incoming', scriptCompiled: 'var DESC_MAX_LENGTH=140;var JIRA_LOGO="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACRElEQVRYhbWXsUscQRTGf4iIyHHIISIWIsHisMgfkNIiBJFwiKQIkipVqpA/wEZEggSxEkmZwiKI5A84REKKkIMQrINYBQmHBDmEHJdNMW+42dk3d3O76wcDu2/e973vZvfN7EF+PAfaMjYL6AzFJFBRYh0gkdEBpryciuQVwjPgFugCu068CvQcAz1g2pnfEc6taOTGL6dIAjxw5nad+FsnvuhxrosYuPbElrz5Rc8Ucu9yfhcxsAncYZZ4fwTeO+HcUcILWgFqOXg1si9vFBrAXB7iEMySfYQZzGCeWxdoAq+Bh8BYjoJjwn0jWrYrqsOIbdIvUQLseTmPgHXgiYx1ibnYU3RuYpyfKMQ/mNWx+KzkfHHmZ4Tj55zGGNhQiAlw5OQ8VeYbzvxRQCNqUxoHLgMCa07eRyd+4sTXAtwrYCLGAJje1URugLrkVIHvMuyLVZccjfsitrhFMyD0k36bTtA/cOZkTuOckaOTFtA7IgEuSG9ONeBHILctWrnwGNO/mvA3zAk4LddaThfTpoXwKiBuVyL0yxPhloLtAUVCY7us4hb7IxQ/KLu4xWFE8cP7Kg6mld4PKH5BvoNrZBMfBphohKnFMAusyvU48ClgoA3M34eBUynwUu6ngK8BE1Gn3ihYccR79Jd5nuyXsx0rZRo498Q7mK8dMDudZuC8rOLLgQI7Ts5xIGe5DANbinCP9AfmEul/SnZslWHgTBFuKnna8a3lpRCzadSVWMiAj6GPIMbAX+/+H9BS8loyN4ibwX9j/jIXDkk+pgAAAABJRU5ErkJggg==";function stripDesc(str){return str&&str.length>DESC_MAX_LENGTH?str.slice(0,DESC_MAX_LENGTH-3)+"...":str}function prepareAttachment(_ref,text){var issue=_ref.issue,user=_ref.user;var issueType=issue.fields.issuetype;var res={author_name:user.displayName,author_icon:user.avatarUrls["24x24"],thumb_url:issueType.iconUrl};if(text){text=text.replace(/\\{\\{(user|issue)\\.([^a-z_0-9]+)\\}\\}/g,function(m,type,key){return(type==="user"?user:issue)[key]});res.text=text}return res}var Script=function(){function Script(){}var _proto=Script.prototype;_proto.process_incoming_request=function process_incoming_request(_ref2){var request=_ref2.request;var data=request.content;try{if(!data.issue||data.user&&data.user.name==="gitlab"){return}var issue=data.issue;var baseJiraUrl=issue.self.replace(/\\/rest\\/.*/,”");var user=data.user;var assignedTo=issue.fields.assignee&&issue.fields.assignee.name!==user.name?", assigned to “+issue.fields.assignee.displayName:”";var issueSummary=""+issue.key+" “+issue.fields.summary+” ("+issue.fields.priority.name.replace(/^\s*\d*\.\s*/,"")+assignedTo+")";var message={icon_url:issue.fields.project&&issue.fields.project.avatarUrls&&issue.fields.project.avatarUrls[“48x48”]||JIRA_LOGO,attachments:};if(data.webhookEvent===“jira:issue_created”){message.attachments.push(prepareAttachment(data,“Created “+issueSummary+”:<br>”+stripDesc(issue.fields.description)))}else if(data.webhookEvent===“jira:issue_deleted”){message.attachments.push(prepareAttachment(data,“Deleted “+issueSummary))}else if(data.webhookEvent===“jira:issue_updated”){if(data.changelog&&data.changelog.items){var logs=;data.changelog.items.forEach(function(change){if(!change.field.match(“status|resolution|comment|priority”)){return}if(change.field===“description”){logs.push(“Changed description to:<br>”+stripDesc(change.toString))}else{logs.push(”"+change.field+" changed from “+change.fromString+” to “+change.toString+””)}});logs.length&&message.attachments.push(prepareAttachment(data,“Updated “+issueSummary+”:<br> - “+logs.join(”<br> - “)))}if(data.comment){var comment=data.comment;var action=comment.created!==comment.updated?“Updated comment”:“Commented”;message.attachments.push(prepareAttachment(data,”"+action+" on “+issueSummary+”:<br>”+stripDesc(comment.body)))}}if(message.text||message.attachments.length){return{content:message}}}catch(e){console.log(“jiraevent error”,e);return{error:{success:false,message:(e.message||e)+" “+JSON.stringify(data)}}}};return Script}();’, token: ‘vGNMrbYKuBMepqa7ec7xYN7qiDxptbNiNzwuSGDCWDRywq32’, userId: ‘aBPPdyb9zSLxeRpLw’, _createdAt: 2020-09-28T07:35:07.407Z, _createdBy: [Object], _updatedAt: 2020-09-28T10:29:08.662Z, _updatedBy: [Object] }, success: true } }
I20200928-11:08:45.924(0) server.js:204 Meteor ➔ method readMessages -> userId: GY56GR6i9jCmEnthd, arguments: [“p3paZ7DXR6gPKkEcX”]
I20200928-11:08:46.929(0) server.js:204 Meteor ➔ method UserPresence:online -> userId: GY56GR6i9jCmEnthd, arguments: [{}]
I20200928-11:08:58.923(0) server.js:204 API ➔ debug POST: /hooks/F23u4CY7wrQMnekzj/vGNMrbYKuBMepqa7ec7xYN7qiDxptbNiNzwuSGDCWDRywq32?user_id=rc.user%40meinemail.net&user_key=rc.user%40meinemail.net
I20200928-11:08:58.924(0) server.js:204 Integrations ➔ Incoming WebHook.info Post integration: gpmuser
I20200928-11:08:58.925(0) server.js:204 Integrations ➔ Incoming WebHook.debug @urlParams: { integrationId: ‘F23u4CY7wrQMnekzj’, token: ‘vGNMrbYKuBMepqa7ec7xYN7qiDxptbNiNzwuSGDCWDRywq32’ }
I20200928-11:08:58.926(0) server.js:204 Integrations ➔ Incoming WebHook.debug @bodyParams: { timestamp: 1601291338508, webhookEvent: ‘comment_created’, comment: { self: ‘https://jira-server/rest/api/2/issue/15452/comment/14515’, id: ‘14515’, author: { self: ‘https://jira-server/rest/api/2/user?username=rc.user%40meinemail.net’, name: ‘user@meinemail.net’, key: ‘user@meinemail.net’, avatarUrls: [Object], displayName: ‘Vorname Nachname’, active: true, timeZone: ‘Europe/Berlin’ }, body: ‘sfdsfd’, updateAuthor: { self: ‘https://jira-server/rest/api/2/user?username=rc.user%40meinemail.net’, name: ‘user@meinemail.net’, key: ‘user@meinemail.net’, avatarUrls: [Object], displayName: ‘Vorname Nachname’, active: true, timeZone: ‘Europe/Berlin’ }, created: ‘2020-09-28T13:08:58.508+0200’, updated: ‘2020-09-28T13:08:58.508+0200’ } }
I20200928-11:08:58.932(0) server.js:204 Integrations ➔ Incoming WebHook.debug [Process Incoming Request result of Trigger gpmuser :] No data
I20200928-11:08:58.933(0) server.js:204 API ➔ debug Success { statusCode: 200, body: { success: true } }
I20200928-11:08:59.097(0) server.js:204 API ➔ debug POST: /hooks/F23u4CY7wrQMnekzj/vGNMrbYKuBMepqa7ec7xYN7qiDxptbNiNzwuSGDCWDRywq32?user_id=rc.user%40meinemail.net&user_key=rc.user%40meinemail.net
I20200928-11:08:59.098(0) server.js:204 Integrations ➔ Incoming WebHook.info Post integration: gpmuser
I20200928-11:08:59.101(0) server.js:204 Integrations ➔ Incoming WebHook.debug @urlParams: { integrationId: ‘F23u4CY7wrQMnekzj’, token: ‘vGNMrbYKuBMepqa7ec7xYN7qiDxptbNiNzwuSGDCWDRywq32’ }
I20200928-11:08:59.102(0) server.js:204 Integrations ➔ Incoming WebHook.debug @bodyParams: { timestamp: 1601291338508, webhookEvent: ‘jira:issue_updated’, issue_event_type_name: ‘issue_commented’, user: { self: ‘https://jira-server/rest/api/2/user?username=rc.user%40meinemail.net’, name: ‘user@meinemail.net’, key: ‘user@meinemail.net’, emailAddress: ‘user@meinemail.net’, avatarUrls: { ‘48x48’: ‘https://jira-server/secure/useravatar?ownerId=rc.user%40meinemail.net&avatarId=11600’, ‘24x24’: ‘https://jira-server/secure/useravatar?size=small&ownerId=rc.user%40meinemail.net&avatarId=11600’, ‘16x16’: ‘https://jira-server/secure/useravatar?size=xsmall&ownerId=rc.user%40meinemail.net&avatarId=11600’, ‘32x32’: ‘https://jira-server/secure/useravatar?size=medium&ownerId=rc.user%40meinemail.net&avatarId=11600’ }, displayName: ‘Vorname Nachname’, active: true, timeZone: ‘Europe/Berlin’ }, issue: { id: ‘15452’, self: ‘https://jira-server/rest/api/2/issue/15452’, key: ‘GPMUSER-502’, fields: { fixVersions: , resolution: null, customfield_10105: ‘0|i00n33:’, customfield_10900: null, customfield_10901: null, customfield_10902: ‘verena@mailadr.net’, customfield_10903: ‘Da ich an einer Schulung teilnehme \r
’ + ‘Ufg \r
’, customfield_10904: ‘Schaller’, customfield_10905: ‘Verena’, customfield_10906: [Array], customfield_10907: ‘08999911211’, customfield_10908: ‘Nicole’, customfield_10909: ‘Nachname’, lastViewed: ‘2020-09-28T12:23:33.067+0200’, customfield_10100: null, customfield_10101: null, timeestimate: null, aggregatetimeoriginalestimate: null, versions: , issuelinks: , assignee: [Object], status: [Object], customfield_11300: null, customfield_11413: null, aggregatetimeestimate: null, creator: [Object], subtasks: , reporter: [Object], aggregateprogress: [Object], customfield_10200: null, customfield_10201: null, customfield_11412: null, customfield_10202: null, customfield_10313: null, customfield_11403: null, customfield_10314: null, customfield_11402: null, customfield_11404: null, customfield_11406: null, customfield_11409: null, customfield_11408: {summaryBean=com.atlassian.jira.plugin.devstatus.rest.SummaryBean@4c5ad470[summary={pullrequest=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@64363282[overall=PullRequestOverallBean{stateCount=0, state='OPEN', details=PullRequestOverallDetails{openCount=0, mergedCount=0, declinedCount=0}},byInstanceType={}], build=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@67e83c92[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BuildOverallBean@329fa0cf[failedBuildCount=0,successfulBuildCount=0,unknownBuildCount=0,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], review=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@114d2c2[overall=com.atlassian.jira.plugin.devstatus.summary.beans.ReviewsOverallBean@20ce9fc1[stateCount=0,state=<null>,dueDate=<null>,overDue=false,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], deployment-environment=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@6642be6[overall=com.atlassian.jira.plugin.devstatus.summary.beans.DeploymentOverallBean@49326a3d[topEnvironments=[],showProjects=false,successfulCount=0,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], repository=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@6e17331b[overall=com.atlassian.jira.plugin.devstatus.summary.beans.CommitOverallBean@3af3998f[count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], branch=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@1defae2c[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BranchOverallBean@47d65c2e[count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}]},errors=[],configErrors=[]], devSummaryJson={"cachedValue":{"errors":[],"configErrors":[],"summary":{"pullrequest":{"overall":{"count":0,"lastUpdated":null,"stateCount":0,"state":"OPEN","details":{"openCount":0,"mergedCount":0,"declinedCount":0,"total":0},"open":true},"byInstanceType":{}},"build":{"overall":{"count":0,"lastUpdated":null,"failedBuildCount":0,"successfulBuildCount":0,"unknownBuildCount":0},"byInstanceType":{}},"review":{"overall":{"count":0,"lastUpdated":null,"stateCount":0,"state":null,"dueDate":null,"overDue":false,"completed":false},"byInstanceType":{}},"deployment-environment":{"overall":{"count":0,"lastUpdated":null,"topEnvironments":[],"showProjects":false,"successfulCount":0},"byInstanceType":{}},"repository":{"overall":{"count":0,"lastUpdated":null},"byInstanceType":{}},"branch":{"overall": environment=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@39508473[overall=com.atlassian.jira.plugin.devstatus.summary.beans.DeploymentOverallBean@1664b28[topEnvironments=[],showProjects=false,successfulCount=0,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], repository=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@6f8696ac[overall=com.atlassian.jira.plugin.devstatus.summary.beans.CommitOverallBean@575c67b7[count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], branch=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@6a921233[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BranchOverallBean@599e2b42[count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}]},errors=[],configErrors=[]], devSummaryJson={"cachedValue":{"errors":[],"configErrors":[],"summary":{"pullrequest":{"overall":{"count":0,"lastUpdated":null,"stateCount":0,"state":"OPEN","details":{"openCount":0,"mergedCount":0,"declinedCount":0,"total":0},"open":true},"byInstanceType":{}},"build":{"overall":{"count":0,"lastUpdated":null,"failedBuildCount":0,"successfulBuildCount":0,"unknownBuildCount":0},"byInstanceType":{}},"review":{"overall":{"count":0,"lastUpdated":null,"stateCount":0,"state":null,"dueDate":null,"overDue":false,"completed":false},"byInstanceType":{}},"deployment-environment":{"overall":{"count":0,"lastUpdated":null,"topEnvironments":[],"showProjects":false,"successfulCount":0},"byInstanceType":{}},"repository":{"overall":{"count":0,"lastUpdated":null},"byInstanceType":{}},"branch":{"overall":{"count":0,"lastUpdated":null},"byInstanceType":{}}}},"isStale":false}}, customfield_11204: null, environment: null, customfield_10910: ‘nicole.schaller@lfst.bayern.de’, customfield_10911: null, duedate: null, comment: [Object] } }, comment: { self: ‘https://jira-server/rest/api/2/issue/15452/comment/14515’, id: ‘14515’, author: { self: ‘https://jira-server/rest/api/2/user?username=rc.user%40meinemail.net’, name: ‘user@meinemail.net’, key: ‘user@meinemail.net’, emailAddress: ‘user@meinemail.net’, avatarUrls: [Object], displayName: ‘Vorname Nachname’, active: true, timeZone: ‘Europe/Berlin’ }, body: ‘sfdsfd’, updateAuthor: { self: ‘https://jira-server/rest/api/2/user?username=rc.user%40meinemail.net’, name: ‘user@meinemail.net’, key: ‘user@meinemail.net’, emailAddress: ‘user@meinemail.net’, avatarUrls: [Object], displayName: ‘Vorname Nachname’, active: true, timeZone: ‘Europe/Berlin’ }, created: ‘2020-09-28T13:08:58.508+0200’, updated: ‘2020-09-28T13:08:58.508+0200’ } }
I20200928-11:08:59.106(0) jiraevent error TypeError: Cannot read property ‘name’ of undefined at Script.process_incoming_request (script.js:1:1930) at evalmachine.:6:23
I20200928-11:08:59.109(0) server.js:204 API ➔ debug Failure { statusCode: 400, body: { success: false, message: `Cannot read property ‘name’ of undefined {“timestamp”:1601291338508,“webhookEvent”:“jira:issue_updated”,“issue_event_type_name”:“issue_commented”,“user”:{“self”:“https://jira-server/rest/api/2/user?username=rc.user%40meinemail.net",“name”:“user@meinemail.net”,“key”:“user@meinemail.net”,“emailAddress”:“user@meinemail.net”,“avatarUrls”:{“48x48”:“https://jira-server/secure/useravatar?ownerId=rc.user%40meinemail.net&avatarId=11600”,“24x24”:“https://jira-server/secure/useravatar?size=small&ownerId=rc.user%40meinemail.net&avatarId=11600”,“16x16”:“https://jira-server/secure/useravatar?size=xsmall&ownerId=rc.user%40meinemail.net&avatarId=11600”,“32x32”:“https://jira-server/secure/useravatar?size=medium&ownerId=rc.user%40meinemail.net&avatarId=11600”},“displayName”:"Vorname Nachname”,“active”:true,“timeZone”:“Europe/Berlin”},“issue”:{“id”:“15452”,“self”:“https://jira-server/rest/api/2/issue/15452",“key”:“GPMUSER-502”,“fields”:{“fixVersions”:[],“resolution”:null,“customfield_10105”:“0|i00n33:”,“customfield_10900”:null,“customfield_10901”:null,“customfield_10902”:“verena@mailadr.net”,“customfield_10903”:"Da ich an einer Schulung teilnehme \r<br>”,“customfield_10904”:“Weiter Text”,“customfield_10905”:“Verena”,“customfield_10906”:[{“self”:“https://jira-server/rest/api/2/customFieldOption/10803",“value”:“ADONIS”,“id”:“10803”}],“customfield_10907”:“08999911211”,“customfield_10908”:“Nicole”,“customfield_10909”:“Nachname”,“lastViewed”:“2020-09-28T12:23:33.067+0200”,“customfield_10100”:null,“customfield_10101”:null,“timeestimate”:null,“aggregatetimeoriginalestimate”:null,“versions”:[],“issuelinks”:[],“assignee”:{“self”:“https://jira-server/rest/api/2/user?username=rc.user%40meinemail.net”,“name”:“user@meinemail.net”,“key”:“user@meinemail.net”,“emailAddress”:“user@meinemail.net”,“avatarUrls”:{“48x48”:“https://jira-server/secure/useravatar?ownerId=rc.user%40meinemail.net&avatarId=11600”,“24x24”:“https://jira-server/secure/useravatar?size=small&ownerId=rc.user%40meinemail.net&avatarId=11600”,“16x16”:“https://jira-server/secure/useravatar?size=xsmall&ownerId=rc.user%40meinemail.net&avatarId=11600”,“32x32”:“https://jira-server/secure/useravatar?size=medium&ownerId=rc.user%40meinemail.net&avatarId=11600”},“displayName”:"Vorname Nachname”,“active”:true,“timeZone”:“Europe/Berlin”},“status”:{“self”:“https://jira-server/rest/api/2/status/10400",“description”:"Die Voraussetzung für die weitere Bearbeitung dieses Vorgangs wurde erstellt.”,“iconUrl”:“https://jira-server/images/icons/statuses/generic.png",“name”:“Erstellt”,“id”:“10400”,“statusCategory”:{“self”:“https://jira-server/rest/api/2/statuscategory/2”,“id”:2,“key”:“new”,“colorName”:“blue-gray”,“name”:“Aufgaben”}},“customfield_11300”:null,“customfield_11413”:null,“aggregatetimeestimate”:null,“creator”:{“self”:“https://jira-server/rest/api/2/user?username=system.benutzer%40meinemail.net”,“name”:“system.benutzer@meinemail.net”,“key”:“system.benutzer@meinemail.net”,“emailAddress”:"",“avatarUrls”:{“48x48”:“https://jira-server/secure/useravatar?ownerId=system.benutzer%40meinemail.net&avatarId=10903”,“24x24”:“https://jira-server/secure/useravatar?size=small&ownerId=system.benutzer%40meinemail.net&avatarId=10903”,“16x16”:“https://jira-server/secure/useravatar?size=xsmall&ownerId=system.benutzer%40meinemail.net&avatarId=10903”,“32x32”:“https://jira-server/secure/useravatar?size=medium&ownerId=system.benutzer%40meinemail.net&avatarId=10903”},“displayName”:"System Benutzer”,“active”:true,“timeZone”:“Europe/Berlin”},“subtasks”:,“reporter”:{“self”:“https://jira-server/rest/api/2/user?username=system.benutzer%40meinemail.net",“name”:“system.benutzer@meinemail.net”,“key”:“system.benutzer@meinemail.net”,“emailAddress”:"",“avatarUrls”:{“48x48”:“https://jira-server/secure/useravatar?ownerId=system.benutzer%40meinemail.net&avatarId=10903”,“24x24”:“https://jira-server/secure/useravatar?size=small&ownerId=system.benutzer%40meinemail.net&avatarId=10903”,“16x16”:“https://jira-server/secure/useravatar?size=xsmall&ownerId=system.benutzer%40meinemail.net&avatarId=10903”,“32x32”:“https://jira-server/secure/useravatar?size=medium&ownerId=system.benutzer%40meinemail.net&avatarId=10903”},“displayName”:"System Benutzer”,“active”:true,“timeZone”:“Europe/Berlin”},“aggregateprogress”:{“progress”:0,“total”:0},“customfield_10200”:null,“customfield_10201”:null,“customfield_11412”:null,“customfield_10202”:null,“customfield_10313”:null,“customfield_11403”:null,“customfield_10314”:null,“customfield_11402”:null,“customfield_11404”:null,“customfield_11406”:null,“customfield_11409”:null,“customfield_11408”:”{summaryBean=com.atlassian.jira.plugin.devstatus.rest.SummaryBean@4c5ad470[summary={pullrequest=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@64363282[overall=PullRequestOverallBean{stateCount=0, state=‘OPEN’, details=PullRequestOverallDetails{openCount=0, mergedCount=0, declinedCount=0}},byInstanceType={}], build=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@67e83c92[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BuildOverallBean@329fa0cf[failedBuildCount=0,successfulBuildCount=0,unknownBuildCount=0,count=0,lastUpdated=,lastUpdatedTimestamp=],byInstanceType={}], review=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@114d2c2[overall=com.atlassian.jira.plugin.devstatus.summary.beans.ReviewsOverallBean@20ce9fc1[stateCount=0,state=,dueDate=,overDue=false,count=0,lastUpdated=,lastUpdatedTimestamp=],byInstanceType={}], deployment-environment=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@6642be6[overall=com.atlassian.jira.plugin.devstatus.summary.beans.DeploymentOverallBean@49326a3d[topEnvironments=,showProjects=false,successfulCount=0,count=0,lastUpdated=,lastUpdatedTimestamp=],byInstanceType={}], repository=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@6e17331b[overall=com.atlassian.jira.plugin.devstatus.summary.beans.CommitOverallBean@3af3998f[count=0,lastUpdated=,lastUpdatedTimestamp=],byInstanceType={}], b

[…]

\":false}}",“customfield_11204”:null,“environment”:null,“customfield_10910”:"nicole.schaller@lfst.bayern.de",“customfield_10911”:null,“duedate”:null,“comment”:{“comments”:[{“self”:“https://jira-server/rest/api/2/issue/15452/comment/14391",“id”:“14391”,“author”:{“self”:“https://jira-server/rest/api/2/user?username=rc.user%40meinemail.net”,“name”:“user@meinemail.net”,“key”:“user@meinemail.net”,“emailAddress”:“user@meinemail.net”,“avatarUrls”:{“48x48”:“https://jira-server/secure/useravatar?ownerId=rc.user%40meinemail.net&avatarId=11600”,“24x24”:“https://jira-server/secure/useravatar?size=small&ownerId=rc.user%40meinemail.net&avatarId=11600”,“16x16”:“https://jira-server/secure/useravatar?size=xsmall&ownerId=rc.user%40meinemail.net&avatarId=11600”,“32x32”:“https://jira-server/secure/useravatar?size=medium&ownerId=rc.user%40meinemail.net&avatarId=11600”},“displayName”:"Vorname Nachname”,“active”:true,“timeZone”:“Europe/Berlin”},“body”:"[~robert.werner@meinemail.net] [~anderer.user@meinemail.net] Zum ersten Mal jemand mit einem solchen Wunsch.\r<br>\r<br>Wie verfahrt ihr denn hier sonst? Sollen solche Anmeldungen hier auch durch? Oder gab es nicht Schulungsuser?\r<br>\r<br>Wenn die hier nicht durchlaufen sollen/müssen, würde ich das auf der Plattformseite vermerken…",“updateAuthor”:{“self”:“https://jira-server/rest/api/2/user?username=rc.user%40meinemail.net",“name”:“user@meinemail.net”,“key”:“user@meinemail.net”,“emailAddress”:“user@meinemail.net”,“avatarUrls”:{“48x48”:“https://jira-server/secure/useravatar?ownerId=rc.user%40meinemail.net&avatarId=11600”,“24x24”:“https://jira-server/secure/useravatar?size=small&ownerId=rc.user%40meinemail.net&avatarId=11600”,“16x16”:“https://jira-server/secure/useravatar?size=xsmall&ownerId=rc.user%40meinemail.net&avatarId=11600”,“32x32”:“https://jira-server/secure/useravatar?size=medium&ownerId=rc.user%40meinemail.net&avatarId=11600”},“displayName”:"Vorname Nachname”,“active”:true,“timeZone”:“Europe/Berlin”},“created”:“2020-09-25T09:03:46.000+0200”,“updated”:“2020-09-25T09:03:46.000+0200”},{“self”:“https://jira-server/rest/api/2/issue/15452/comment/14500",“id”:“14500”,“author”:{“self”:“https://jira-server/rest/api/2/user?username=anderer.user%40meinemail.net”,“name”:“anderer.user@meinemail.net”,“key”:“anderer.user@meinemail.net”,“emailAddress”:“anderer.user@meinemail.net”,“avatarUrls”:{“48x48”:“https://jira-server/secure/useravatar?ownerId=anderer.user%40meinemail.net&avatarId=11504”,“24x24”:“https://jira-server/secure/useravatar?size=small&ownerId=anderer.user%40meinemail.net&avatarId=11504”,“16x16”:“https://jira-server/secure/useravatar?size=xsmall&ownerId=anderer.user%40meinemail.net&avatarId=11504”,“32x32”:“https://jira-server/secure/useravatar?size=medium&ownerId=anderer.user%40meinemail.net&avatarId=11504”},“displayName”:"Joachim Borchers”,“active”:true,“timeZone”:“Europe/Berlin”},“body”:"

[…]

Nachname",“active”:true,“timeZone”:“Europe/Berlin”},“created”:“2020-09-28T13:08:58.508+0200”,“updated”:“2020-09-28T13:08:58.508+0200”}}` } }

Ok, I got it.

But I had to use the script from this Github issue: https://github.com/RocketChat/Rocket.Chat/issues/14760