How to change custom field value when issue is edited

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

This widget could not be displayed.

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 :)

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
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

114 views 1 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you