User Tools

Site Tools


behaviours

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
behaviours [2019/07/11 09:44]
root
behaviours [2020/07/21 11:08] (current)
root
Line 11: Line 11:
 </code> </code>
 Reference: [[https://scriptrunner.adaptavist.com/5.4.45/jira/behaviours-api-quickref.html|ScriptRunner]] Reference: [[https://scriptrunner.adaptavist.com/5.4.45/jira/behaviours-api-quickref.html|ScriptRunner]]
 +
 +==== Verify that assignee for the ticket is within the range of usernames ====
 +<code java>
 +def ticketAssignee = getFieldById("assignee")
 +def ticketAssigneeValue = ticketAssignee.getValue()
 +
 +if (!['', 'user1', 'user2'].contains(ticketAssigneeValue)){
 +    ticketAssigneeValue.setError("Sorry, you cannot assign to this user")
 +} else {
 +    ticketAssigneeValue.clearError()
 +}
 +
 +</code>
behaviours.txt ยท Last modified: 2020/07/21 11:08 by root