How to fire an event when work log added,updated and deleted for a issue in Jira?

ARUN KUMAR MK
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.
July 26, 2016

I have triggered an Issue resolved event using the post function during the Resolution transition and captured it in event listener. Now i want to capture the Worklog, issue update and many more events on the listener. How to fire those events?

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Jobin Kuruvilla [Adaptavist]
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.
July 26, 2016

JIRA already throws events for worklog changes. See https://confluence.atlassian.com/adminjiraserver071/adding-a-custom-event-802592793.html#Addingacustomevent-Systemevents

You just need to catch them in your listener.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 26, 2016

Events are already fired for almost all changes in JIRA, so I'm not sure why you even needed to do " have triggered an Issue resolved event using the post function during the Resolution transition" - if you're using the default workflows, it does that off-the-shelf, without you needing to do anything at all.

Worklog changes all fire events, you just need to listen for them.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 26, 2016

Ah, Jobin beat me to it.

ARUN KUMAR MK
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.
July 26, 2016

Thanks for the reply Jobin and Nic.

Oh Is that so? But in the post function it has generic event, I doesn't know what it will do. And also my listener doesn't catch the resolved event, when i click Done. So i used to go to post function and change the generic event to Issue Resolved event. I thought likewise i have to Trigger all the events. Any way i will try to catch the work log event.

image2016-7-27 12:55:18.png

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 27, 2016

So what you're saying is that you're using your own workflow and you have configured the standard "fire event" post-function to send "resolved" instead of the default "generic" event.   Your statement " have triggered an Issue resolved event using the post function during the Resolution transition" implies that you had done something else to fire an event.

That's good though, using the standard post-function is exactly what you should be doing, so it's just my misunderstanding of your writing that was a problem. 

The  point here is that the transition was throwing out "generic event" and is now throwing out "issue resolved", so your listener should be catching that fine, and it sounds like it is.  Now all you need to to is extend the code in it so that it picks up the worklog events.  You don't need to change anything to get them to fire - they are hard coded into the core of JIRA - someone does something to a worklog and the right event will fire.

TAGS
AUG Leaders

Atlassian Community Events