Hey there,
I'd like to write a postfunction script with Adaptavist ScriptRunner witch sets an assignnee automatically.
could someone please tell me whats wrong about this code:
def user
if(condition1){
user = "test1"
}else(condition2){
user = "test2"
}
log.warn(user) // tells me that there is an user
issue.setAssignee(userManager.getUserByName(user))
All tickets are not assigned after running throw this script although the script is not failing.
I read the script runner documentation but I couldn't find a solution.
Thanks for your help beforhand.
Hi Robin,
What is the order of your post-functions? Have you tried moving this script post-function as the last item on the list?
Also, have a look at this script on our Library website:
https://library.adaptavist.com/entity/update-the-assignee-of-an-issue-in-jira
You may need to use the updateIssue() method.
Regards,
Josh
Hi Joshua,
thanks you a lot. Now it works fine.
For all interested:
def user
if(condition1){
user = "test1"
}else(condition2){
user = "test2"
}
log.warn(user) // tells me that there is an user
issue.setAssignee(userManager.getUserByName(user))
issueManager.updateIssue(user, issue, EventDispatchOption.ISSUE_UPDATED,false)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.