User Tools

Site Tools


behaviours

Differences

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

Link to this comparison view

Next revision
Previous revision
behaviours [2019/07/11 09:43]
root created
behaviours [2020/07/21 11:08] (current)
root
Line 1: Line 1:
 +===== Behaviours =====
  
  
Line 10: 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.1562852612.txt.gz ยท Last modified: 2019/07/11 09:43 by root