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 revisionPrevious revision
Next revision
Previous revision
behaviours [2019/07/11 09:44] rootbehaviours [2026/02/01 12:29] (current) – external edit 127.0.0.1
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.1562852688.txt.gz · Last modified: (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki