Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can we write a post function based on a field change and NOT require a state transition?

Mark Green August 28, 2021

I am trying to make a change to our Jira system so that any time someone changes the Product Area, it will change a "team" custom field for that bug to the team that owns that product area.

Post functions can do this, but have the shortcoming of only firing on a state transition (i.e. "Issue Created", "Resolved", etc).

Is there any way we can create a post function that fires on any save event or if a certain custom field like "Product Area" changes?

Thanks in advance!

1 answer

0 votes
Fabian Lim
Community Champion
August 28, 2021

Hi @Mark Green

Yes there is a way by combining a transition that calls itself with a combination of a transition screen.

1. Create a transition to itself and call it "some action"

2. Create a new screen with the customtield 'product area". Note the comment field will show no matter what by default. You will also have to ensure that product area is not in the edit screen.

3. Add the new screen to the transition

4. Assign the postfuntion

The other option is to use jira automation with an issue field changes trigger and then executing an action.

1. Trigger: issue field changes on product area

2. Conditions: you may have to use if statements depending on the product area options

3. Action: edit team custom field

I hope this helps.

Mark Green August 30, 2021

Hi Fabian,

Thank you very much for a quick and thoughtful response with a few options to consider.

The first suggestion confuses me a bit.  Is there a behaviour within Jira where a new "fake" state transition that only connects to itself is executed during any save?  Forgive me if I am misunderstanding that option as I'm struggling to understand how/why it works.

Looks like I have some studying to do around Jira Automations!  What I am doing is sophisticated enough that I imagine I may need to think about purchasing something like "ScriptRunner" to be able to code a pretty complicated mapping.

Thanks again!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events