Hello,
In Jira Server, I would like to block a transition as long as a field (assignee) has not been modified from its original value. Do you have a solution for that ?
Can Script runner be used ?
Thank you.
Nath
Hi @Nath ,
Script Runner could indeed be used for that, more specifically behaviours. You can compare the form value to the actual value (using underlyingIssue object). If they are the same, you can set an error on the form. Let me know if you need more guidance.
Antoine
Hi,
I try to recover the initial value of the field "assignee" and the one entered by the user, but I do not have the same result, while the target user is identical. Is there a method to obtain comparable results, or should I reprocess the initial data obtained, to obtain comparable elements ?Thank you in advance for your help.
Here is the code in my Behaviours :
String fieldAssignee = getFieldById("assignee") fieldAssignee.setRequired(true) String assigned = underlyingIssue.assignee?.displayNameString myValue = underlyingIssue.assigneeif (myValue == fieldAssignee){ fieldAssignee.setError("My error")}
Hi Nath,
Try this (link the behaviours to the Assignee field) :
def formAssignee = getFieldById("assignee")formAssignee.setRequired(true)def formAssigneeValue = (formAssignee.getValue() == null) ? "" : formAssignee.getValue().toLowerCase()String issueAssigneeValue = (underlyingIssue.getAssignee() == null) ? "" : underlyingIssue.getAssignee().getKey().toLowerCase()if (formAssigneeValue == issueAssigneeValue){formAssignee.setError("My error")}else {formAssignee.clearError()}
It looks like you're new here. Sign in or register to get started.