Update trigger

gil September 13, 2013
how do I fire an event upon an update of a field? Thanks.

3 answers

0 votes
Jason Plumhoff
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.
September 14, 2013
You might be able to use the script runner plugin instead of having to write your own plugin. I believe it supports the creation of custom conditions, validators, and post functions. Of course, this will only help you on workflow transitions - not direct edits. https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner
Normann P. Nielsen (Netic)
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.
January 9, 2014

Is it possible - without writing my own plugin - to catch every "Save" (Update) event and firing a script?

As I see it, events and notifications are only during transitions, but I would like to catch every "update" and fire a groovy script or similar - like creating a LISTENER to fire a Groovy/Jelly

BR.

Normann

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.
January 9, 2014

No, and you're wrong about events and transitions.

Events are thrown by EVERY change to an issue. Not just transitions. Issue commented by comments (no transition there), issue update by any change of fields (no transition there), and so on...

And "no" because you need to write *something* to catch the events and trigger any actions. You don't necessarily need to write your own plugin - the script runner allows you to write listeners inside itself for example, but you still need to write something in there to perform any actions.

0 votes
gil September 14, 2013

Thanks for the quick reply, Nic.

Here is what I need to accomplish, there's a JIRA field and I want to validate the content based on some logic, before user can save the changes on the submit/update form. There are several validator plugin on the market, but I don't think they meet my needs. I think the only approach is to write a custom plugin in JIRA. Wondering how to get started on this.

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.
September 14, 2013

Simple "get you started" answer - use the Atlassian SDK to write a validator plugin. I don't know how familiar you might be with coding, but start at https://developer.atlassian.com/display/JIRADEV/Workflow+Plugin+Modules for details on writing a workflow plugin such as a validator. If you've never looked at writing an Atlassian based plugin before, then you probably want to look higher up the page-tree for the getting-started guides too.

Like Blanka Meinhardt likes this
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.
September 14, 2013

You don't. Events are fired on all issue updates. The event contains a list of all changes, so what you do is catch any issue event and look for a change in the content of the field you are interested in.

Suggest an answer

Log in or Sign up to answer