How can I create a custom event to trigger a custom listener when a custom field get updated

Greeshma A R February 9, 2018

I am trying to use the Script Runner plugin section for Custom Listeners to fire an  custom event when a particular custom field is updated, but i can't find any option in jira to create a custom event for triggering custom Listener

1 answer

1 accepted

0 votes
Answer accepted
Alexey Matveev
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.
February 9, 2018
Greeshma A R February 11, 2018

I don't want to send notification, but i want to trigger a custom listener which i wrote in script listener when ever an custom field in the issue get updated.Is it possible to create a custom event to invoke a listener?

Alexey Matveev
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.
February 11, 2018

You can throw an event with

IssueManager.updateIssue(ApplicationUser user, MutableIssue issue, UpdateIssueRequest updateIssueRequest)

You set an event in UpdateIssueRequest. But the event must be created first before you can throw it.

Greeshma A R February 12, 2018

But, I want to trigger updateIssue only if a particular custom field (says functionality) get updated.How to give this condition in updateIssue

Alexey Matveev
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.
February 12, 2018

It seems to me that the architecture of your application is too much complicated.

But you know better. You could create a listener on the Update Issue Event and check what fields changed. If the required field changed then you can raise an event. You can find more info here

https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-detect-if-a-field-value-was-changed/qaq-p/545861

Look at Sascha Becker answer

Greeshma A R February 18, 2018

It worked.Thanks you alexey

Andrew P May 31, 2018

<b>uh

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events