Forums

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

I have a Jira REST plug-in that creates and updates issues. How can it do this but not trigger event

Rich Scire
Contributor
June 8, 2018

I'm integrating Jira with ServiceNow. I wrote a REST plugin that Snow calls to create or update Jira issues. On the Jira side, I have ScriptRunner listeners that react to various events to capture creation and changes to Jira issues and sends the information to Snow.

The problem is that when the REST module makes changes to the Jira issue, it triggers update and other events that cause the listeners to send the same changes back to Snow.

I've set a flag to indicate when an update has been made by the REST module so that the listener can ignore any updates made by REST. Unfortunately, the updates can trigger multiple events but only the first one is ignored using the flag.

I'm wondering if there is any way the REST module can suppress the firing of the events or if anyone can provide any other suggestions.

1 answer

1 accepted

1 vote
Answer accepted
Prakhar Srivastav {Appfire}
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.
June 9, 2018

@Rich Scire

See if this public issue helps you :

 

https://jira.atlassian.com/browse/JRASERVER-34423

 

Regards

Prakhar

Rich Scire
Contributor
June 11, 2018

Thanks for the suggestion but unfortunately, that doesn't solve my problem. The issue you refer to above tell how to avoid sending notifications but not how to repress the triggering of event.

Prakhar Srivastav {Appfire}
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.
June 11, 2018

@Rich Scire

Ok. I see that, earlier I thought you just want to stop sending notification.

Now coming back to your problem , if JIRA REST API does not provide any way to stop sending event , then I guess you may have to write you own REST Plugin Module for JIRA.

When you do that and use updateIssue method then you can choose eventDispatchOption to stop triggering all the event.

https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/issue/IssueManager.html#updateIssue-com.atlassian.jira.user.ApplicationUser-com.atlassian.jira.issue.MutableIssue-com.atlassian.jira.event.type.EventDispatchOption-boolean-

Regards

Prakhar

Rich Scire
Contributor
June 11, 2018

Excellent, thanks!

Suggest an answer

Log in or Sign up to answer