Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Last ID to perform an update

Howell
Contributor
October 13, 2022

We are implementing integration with BMC Remedy.

Remedy has an OOTB feature which sends a comment to Jira every time an update is sent from Jira.

Example:  when Summary is updated in Jira and sent to Remedy, Remedy sends back a comment "Summary was updated in Remedy".  

We were told that this can't be disabled.  This is now causing a problem at our side because it triggers again the Update webhook and the same information gets sent back to Remedy.

The solution is to add JQL in the webhook to exclude updates done by the Remedy ID.  We used Last Updated By but found out that it searches the entire history.  If any update was done previously by the Remedy ID, the webhook won't fire anymore.

We added a time parameter but the minimum is 1 minute.  This means that when our Jira users update a field, they need to wait at least 1 minute before they can do another save.  Otherwise the data won't be sent to Remedy.

Anyone encountered this before and how did was the issue solved?

We are thinking of using some sort of update flag but updating this flag triggers the update webhook as well.  

 

2 answers

1 accepted

1 vote
Answer accepted
Krister Broman _Advania_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 14, 2022

I generally use the automation feature instead of the webhook. Automation post web request is much easier to configure. 

Then you just set an if statement where the initiator of the action is not done by the RemedyID

Krister Broman _Advania_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2022

You can set it to wait for a response that is then stored as a variable in {{webhookResponse.status}} 

You can then use that response for different tasks. I usually use it to either close the issue that initiated the task or assign it to a human for action. But you could certainly add an email task that runs if anything else than a 200 response from the target.  

Here are some links for you to see more possibilities

https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

https://confluence.atlassian.com/automation074/send-web-request-action-now-provides-response-data-1141481224.html

Howell
Contributor
October 18, 2022

Thanks Krister!  Our initial tests showed that the approach is working.  However, our vendor informed us that massive code changes are required at their side.

I will mark this as the answer.

Krister Broman _Advania_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 20, 2022

You can create a custom message this should be possible to configure to roughly the exact message the vendor previously received. Just set message load to custom and configure it to what the receiving system expects 

Example for sending a Json formated message

Headers

Content-Type   application/json

Custom Message

{
  "self": "{{url}}",
  "Key": "{{issue.key}}",
  "Summary": "{{issue.summary}}",
  "Description": "{{issue.description}} ",
  "Contact": "{{issue.reporter.emailAddress}}",
  "Urgency": "{{issue.urgency}}", 
  "Priority": "{{issue.priority}}",
  "Impact": "{{issue.impact}}",
  "Tickettype": {{#if(equals(issue.issueType.name, "Incident"))}}"Incident",{{/}}{{#if(not(equals(issue.issueType.name, "Incident")))}}"Request",{{/}}
  "Attachments": [{{#triggerIssue.attachment}}
    {"url": "{{content}}"}{{^last}},{{/}}
    {{/triggerIssue.attachment}}
  ]
}

So some explanations

  "self": "{{url}}", - I generally add self for error mgmnt 

  "Tickettype": {{#if(equals(issue.issueType.name, "Incident"))}}"Incident",{{/}}{{#if(not(equals(issue.issueType.name, "Incident")))}}"Request",{{/}} - when the target system can only receive certain issuetypes we can rename our issuetypes, in this case any incident will create incident, anything else will create a request. 

  "Attachments": [{{#triggerIssue.attachment}}
    {"url": "{{content}}"}{{^last}},{{/}}
  {{/triggerIssue.attachment}} - Sending a list of attachments, attachments can be tricky to get over to receiving system. In this case we use an integration engine that handles download, converting to target data and uploading. 

Howell
Contributor
October 24, 2022

Thanks Krister!

After further discussions with our vendor, they managed to restrict the sending of notifications to only actual updates occurring on Remedy.  As switching to automation has a huge impact on their code, it was decided to remain with the webhooks and accept the issue as a known limitation.

If only Atlassian can provide a built-in function to get the last ID that performed the update for Data Center :D

0 votes
Howell
Contributor
October 16, 2022

Thanks Krister!

A side question to this, can automation detect whether the webhook failed and send out an email notication?

Gaurav
Community Champion
October 20, 2022

Hello @Howell 

You can set a condition on the smart value {{webhookResponse.status}} and if this fails, you can send an email to relevant users under action.

Please let me know if this helps.

--GG

Howell
Contributor
October 24, 2022

Thanks Gaurav!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events