When users asign issues to each other via the standard asign-function in JIRA (not via workflow transition) I'd like the commentary field to be mandatory. Is that possible in any way?
You bet it is! This can be done with a Behaviour. Create a behaviour on the Assignee field with a validation script like the one below:
import com.atlassian.jira.component.ComponentAccessor import com.onresolve.jira.groovy.user.FieldBehaviours import groovy.transform.BaseScript @BaseScript FieldBehaviours fieldBehaviours def commentField = getFieldById("comment") def assignee = getFieldById(getFieldChanged()) def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser() log.debug("Assignee: $assignee.value ; Current User: $currentUser.name") boolean requireComment = assignee.value != currentUser.name && underlyingIssue.getAssignee().name != assignee.value && assignee.value log.debug("Comment required: $requireComment") commentField.setRequired(requireComment)
That will make the comment field required whenever the assignee is not "unassigned" and it's not the same user as the person doing the assignment. It should work on the edit issue and assign issue screens.
Yes, Johny's script might help you. In addition to that, you can remove Assignee field from edit screen and hence, it will be available only in Assign screen. Otherwise, the user can cheat you by performing an inline edit of Assignee in the view screen itself.
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot