Is there a way that Script Runner can display a custom screen once a custom field is selected to a certain value?
ie: Custom Field 'Review' is set to Yes, from No.
Script Runner Behaviour will identify the change, and display this Screen, which is different from the Create , Edit , and View Screens.
Anyone know how to do this?
I have a script, below, which requires a comment. But the Edit screen that it is using contains a bunch of fields, and I want to limit the 'noise' if possible.
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
import com.atlassian.jira.issue.comments.CommentManager
@BaseScript FieldBehaviours fieldBehaviours
def regressionIssueField = getFieldById(getFieldChanged())
def regressedVersionField = getFieldById("comment")
String regressionIssueValue = regressionIssueField.getValue()
if (regressionIssueValue == "Yes") {
regressedVersionField.setRequired(true)
} else {
regressedVersionField.setRequired(false)
}
Hi lukec,
I'm going to say, yes it can but you shouldn't. It makes more sense to use screen tabs and Scriptrunner Behaviours to organize and hide the fields. You should also consider moving some of them to transitions screens, possibly transition screens on a "loop" transition (transition from a status to itself). Cheers!
I couldn't get it. Made a "loop" transition. But couldn't get the issue to loop based on the Custom Field being changed.
I could do that with Automation for Jira.. go from In Progress to In Progress.. but requiring the comment during that transition (via workflow) prevents the Automation from completing. It errors out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lukec,
Can you include a comment in the automation or remove the requirement? Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Joshua .. the comment will be different every time depending on the situation and the user will need to specify each time.
The requirement cannot be removed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lukec,
Then you cannot use the method you are seeking to use. It's also a bad idea to extend Jira sufficiently that you can produce pop-up screens at will, your future self/admins will either love/hate your current self based on this decision.
I would recommend using methods a bit closer to what comes out of the box and then use some form of automation to do math/logic/etc, but do not use scripting to make your instance do something that approximately 100% of other instances do not do. That is asking for problems.
Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.