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
Next: Root
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
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
We have a text field we would like to be populated on resolve/close but only when the resolution is fixed, complete, or cannot reproduce. Is this possible?
you could create 2 transitions:
And use 2 diferent transition screens and validators.
Thanks, but that's really not what we're looking for. We need a validator that incorporates conditional logic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is a script for simple script validator:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.fields.CustomField switch (issue?.getResolutionObject().getName()){ case "fixed": case "complete": case "cannot reproduce": CustomField textField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("field name") return issue?.getCustomFieldValue(textField) != null; default: return true; }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the transitions that go to the Resolved status (or whatever name you use for that status), you need to have a screen that includes the fields you want to validate and any other fields that you want to allow the agents to edit during the transition.
Using a Validator in the workflow will not put the "required field" asterisk next to those fields, but you can provide a message that will display if the validation fails. You can check each required field in a separate validator, or combine multiple fields in a single validator. The validators will be gone through in order, but only one validator's message will display. If there are multiple missing required fields, only the message for the first missing required field will display.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Vasiliy Zverev but that organization didn't have ScriptRunner.
@Archer Vanwormerson I think if I were to try to solve this now (I've not been with that team in years) then, assuming I was using Jira Cloud (which has built in automation) I would create an automation rule to populate the field under those conditions.
Five years ago, when I wrote this, that wasn't an option. Though, even if we could do so in Cloud, we were using Jira Server.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.