It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Unable to set the assignee of sub-task using ScriptRunner Workflow Post Function

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")

Screen Shot 2019-10-22 at 8.19.31 PM.png

It produces this error message:

Screen Shot 2019-10-22 at 8.14.26 PM.png

[Static type checking] cannot assign value of type java.util.Map to variable of type sr.json.issue.assignee

What am I doing wrong?

1 answer

Hi Chris,

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.

Regards,

Kristian

Thank you for replying Kristian and for clarifying that I can ignore those warnings. I was able to save it, but I still can't get the assignee to populate on my subtask so I suspect there may be another issue preventing me from doing this.

Hi Chris,

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.

Regards,

Kristian

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

247 views 1 2
Join discussion

Community Events

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

Events near you