Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I transition an issue state only after two custom fields have been updated? Edited

I have an issue I'm trying to transition when a custom date, and custom hash field are updated, but only if another field is in the approved state. This last one is a button transition back to the current state (done by someone and would be a lot of work to change). So I'm trying to just leave it alone.

 

So, what I'm trying to do now is use a listener to only transition the issue to the next state in the workflow external review if both variables have been updated and are not set to empty. However, I can only get it to work for a single custom field update. Any ideas on how I could make this listener depend on both being changed?

 

I tried to detect a change in both fields in the same listener script and only transition if both are changed, but that doesn't seem to work (maybe it's not timed right).

 

Any idea on how to handle a two field update transition? I haven't run across any questions that could help me solve this. I'm using Jira 8 by the way, and scriptrunner.

1 answer

0 votes

Here is how I would rephrase your rule... does that seem correct?

When

  • either field A or field B is changed

If

  • both fields contain a value

Then

  • trigger the transition

Or is it important that both fields have just been changed either together via the edit screen or in short succession (perhaps within the last x minutes) via in-line edits?

In the case of screen edit, I think both fields should be in the event.changeLog. But for in-line edits, you would get 2 separate events. So then you need to only fire on the second event, and only if the other field was also recently changed. You'll have to decide what the appropriate time threshold is. And then call the changeHistoryManager to get all the recent changes to see if the other field was also modified.

It's important for both of the fields to have changed. I was going to try your idea of using a time threshold but I couldn't figure out how to get the number of minutes since a change was made to the field. I also wasn't sure how to trigger the listener to fire the right event to play off of the other field to make this work. Currently, I just have the one listener, and I'm not able to detect changes except right when they happen. So, I'm not sure how to handle a change that happened, say 2-3 minutes ago, which would be a reasonable time to allow the ticket transition.

 

Ideally what I want to do is have it auto-transition in whatever order I do it in. So whether the approvals come first, or whether the fields are changed and then the approval transition occurs.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

How to log work and track time in Jira when a person is part of multiple teams

  The manager’s daily activities include a list of challenges to reach high levels of efficiency for their teams. Part of these challenges is related to how to deal with the worklog systems sin...

18 views 0 0
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you