Hello there,
using Jira Cloud I am thinking of how to set a JMWE using Nunjucks to:
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:
(string) TypeError: Cannot read property 'charAt' of undefined
Can anyone help?
Hi @Tereza Červinková ,
you need to use a Set Field Value post-function instead, with this value:
{% if issue.fields["Reporter"].accountId == "accountId:5cd52aaf8ad0f60dca007cef" or issue.fields["Reporter"].accountId == "accountId:5cd44f0df58d4f0dc512d7f5"%}
accountId:5cd52aaf8ad0f60dca007cef
{% else %}
accountId:5da42f701a43fe0ddbb43bab
{% endif %}
Thank you, @Alexander Bondarev and @David Fischer for your help.
The set field value would definitely help me with that, though I have tried the original code, edited it and now it works. So now it is:
{% if issue.fields.assignee.accountId == "accountId:5cd52aaf8ad0f60dca007cef" or issue.fields.assignee.accountId == "accountId:5cd44f0df58d4f0dc512d7f5"%}
{{ issue.fields.assignee.accountId }} = "accountId:5cd52aaf8ad0f60dca007cef"
{% else %}
{{ issue.fields.assignee.accountId }} = "accountId:5da42f701a43fe0ddbb43bab"
{% endif %}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, @Tereza Červinková !
Unfortunatelly, I have never used JMWE in Cloud =(
Have you already checked examples from documentation - Use cases for post-functions .
Also you can raise a supprort request on Customer Portal?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.