How to change custom field value when issue is edited

Georgiy Senenkov May 21, 2012

Hello,

I have post-function script (called in "Create Issue" transition) which sets ”Team” custom field to some particular value which is taken from component description. The script works fine.

Now I would like to implement the same procedure but when issue is edited, e.g. user noticed that wrong component has been selected and modifies the components, and modified component should select another team.

I think "Edit" is not part of workflow, and I do not know when and where script can be called. Could you please advise how "automatical selection" for "Edit Issue" can be implemented?

Thank you in advance.

Regards, Georgiy

1 answer

1 accepted

0 votes
Answer accepted
parthiban subramaniam
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.
May 21, 2012

What you need is a event listener

have a look at the tutorial here for a general picture

https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Writing+JIRA+event+listeners+with+the+atlassian-event+library

have fun coding :)

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.
May 21, 2012

As Parthis says, you'll need a listener. This is because the "edit" function (and most of the other operations) do not have hooks for post-functions, so there's actually nowhere to install and run your code. Listeners pick up events, which "edit" always fires.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events