I am unable to set the assignee of my sub-tasks in the Additional Code section of ScriptRunner Workflow Post Function even when I use the example provided in the app ("Set assignee")
It produces this error message:
[Static type checking] cannot assign value of type java.util.Map to variable of type sr.json.issue.assignee
What am I doing wrong?
Thank you for your question.
I can confirm that the yellow warning triangles next to the code box does not mean the code is invalid and is caused by static type checking, as it means Jira does not fully understand the code.
These warnings can be ignored as often the code will still run as expected with these warnings.
Finally, I can confirm that I have tested the sample code provided above and can confirm that this code is valid and will assign the subtask when a valid account ID for a user is specified in place of the 123456:12345a67-bbb1-12c3-dd45-678ee99f99g0 accountId shown in the sample.
If this response has answered your question can you please mark it as accepted so that other users can see it is correct when searching for similar answers.
Thank you for your response.
Can I please confirm if you replaced the accountId string in the example with a valid accountId for a user in your instance, as a valid accountId will be needed in order for the subtask to be assigned.
Also, can I please ask if the user you are specifying has the Assignable User permission in the project you are creating the sub task in as if the user does not have this permission then the subtask will not be able to be assigned to them.
I can confirm that the simplest way to find out the account id for a user will be to navigate to the People page inside of your Jira cloud instance which you can view by navigating to the URL of <JiraCloudBaseURL>/ people/search.
Once on this page you can search for the name of the user that you need to find the accountID for and you will find the account ID in the URL when you load the people page for the user after the URL of <JiraCloudBaseURL>/ people/ <AccountIDWillBeHere> where the value after the people/ section of the URL is the accountID.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events