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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.