Best way to silently update a custom field when a JIRA issue is created?

I have a custom field that I use for reporting called "Original Project" that my users are populating when they create a JIRA issue. They populate it with the Project they are creating the issue in.

However, I'm able to derive this field based on the Project the user creates the issue in, so why have the user fill it out? I'm wondering how I can just silently update this field in the background based on the Project.

I looked at using a Post Function, but none of them seemed to be "Update a custom field based on the Project".

I could add an event, then add a listener to the event... is that the best way to silently set a custom field based on other info?



1 answer

1 accepted

1 votes

As you've already worked out, you'll need to find or write a plugin to do this. You'll need to choose between post-function and listener as well.

Post-functions run only on transitions, are relatively easy to write, and can be placed in a way such that they only ever run when they are needed. Listeners are more flexible as they can catch any event. (Your comment about "adding an event" needs a bit more info - events are already fired, and it's one event per thing-that-happens, so you probably don't need to worry about adding another one - you've already got "create issue" events happening and you can't add a second event)

On the back of all of that, I'd seriously recommend a look at the script runner plugin. It can bypass the need for another plugin in both cases above and can be a lot more flexible than hard-coding a plugin...

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,854 views 12 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot