Hello there,
using Jira Cloud I am thinking of how to set a JMWE using Nunjucks to:
- set Assignee to Person 1 if the reporter is Person 1 or Person 2 OR ELSE set it to Person 3 if the reporter is different.
Now I know there is an Assign to a Project Role part, but I need to avoid adding new project roles and post-function Build your scrtipt seemed fine.
Now I've gotten here:
{% if issue.fields["Reporter"].accountId == "accountId:5cd52aaf8ad0f60dca007cef" or issue.fields["Reporter"].accountId == "accountId:5cd44f0df58d4f0dc512d7f5"%}
{% set issue.fields.assignee.accountId = "accountId:5cd52aaf8ad0f60dca007cef" %}
{% else %}
{% set issue.fields.assignee.accountId = "accountId:5da42f701a43fe0ddbb43bab" %}
{% endif %}Accounts in code - first is Person 1, then Person 2
set Person 1
else Person 3
But getting error while testing:
Message:
(string)
TypeError: Cannot read property 'charAt' of undefined
Can anyone help?