You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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.
Here is how I would rephrase your rule... does that seem correct?
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.