I need to set Sub task assignee by jython script to a crowd user, like (user1)

I tried below script for that, its able to create sub task but not getting assinged to a user

from com.atlassian.jira import ComponentManager
from com.atlassian.jira.util import ImportUtils
from com.atlassian.jira import ManagerFactory
from com.atlassian.jira import ManagerFactory
issueManager = ComponentManager.getInstance().getIssueManager()
issueFactory = ComponentManager.getInstance().getIssueFactory()
authenticationContext = ComponentManager.getInstance().getJiraAuthenticationContext()
subTaskManager = ComponentManager.getInstance().getSubTaskManager()

issueObject3 = issueFactory.getIssue()
subTask3 = issueManager.createIssue(authenticationContext.getLoggedInUser(), issueObject3)
subTaskManager.createSubTaskIssueLink(issue.getGenericValue(), subTask3, authenticationContext.getLoggedInUser())

I tried adding a line like


but its not working and throughing error saying not able to find user1

do i need to import some crowd user model or i need to tweek script? Please help.

4 answers

if you want to provide username only - try to set

https://docs.atlassian.com/jira/6.2.7/com/atlassian/jira/issue/MutableIssue.html#setAssigneeId(java.lang.String) during creation of issue

issueObject3.setAssigneeId("user1"); (java-style, set syntax according to language)

Thanks Alexey it works very well :-)

Thanks Alexey it works very well :-)

Thanks Alexey it works very well :-)

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 8 hours ago in Agile

What is Scrum? A good, bad, and ugly answer.

In a world of dark-scrum, faux-scrum, and scrum-butt, the question still remains: What is scrum and how do you do it “right?” That’s the question we set out to answer. I'm Max, I've been teaching c...

50 views 0 1
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you