Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JMWE - Create New Issue Post Functions - Route to Different Jira Projects

Emily Lukasik
Contributor
April 24, 2020

Hi - I have create a Post Function, so when a ticket in our Service Desk is moved to In Progress, a new (linked) ticket is created in our Scrum team's project.  

Is it possible to update the post function, so it can route to a different Jira board, based on another value?

 

Example: We have a custom dropdown field for Scrum Team.  

  • If Scrum Team = ABC; create a new issue in Jira Project ABC
  • If Scrum Team = XYZ; create new issue in Jira Project XYZ

1 answer

1 accepted

1 vote
Answer accepted
David Fischer
Community Champion
April 24, 2020

Sure. You can select "Calculated:" as the Destination Project, with a Nunjucks Template like:

{% if issue.fields["Scrum Team"].value == "ABC" %}
ABC
{% elif  issue.fields["Scrum Team"].value == "XYZ" %}
XYZ
{%endif%}

That assumes that "Scrum Team" is a single-select type custom field.

If the value of that custom field is exactly the project key, you could even use this:

{{issue.fields["Scrum Team"].value}}
Emily Lukasik
Contributor
May 5, 2020

Hi - I used the above template with "Calculated" option for Project, but still received a JMWE error.  Unfortunately the JMWE error log is not loading for me so I can't put the specific error at this time.

Confirming:

  • The Squad field (aka Scrum Team) is a Single-Select type custom field (and I selected one of the Squads listed below in my test)
  • The Project Keys (ENG & Data) are correct)

 

{% if issue.fields[Squad].value == "Central Data" %}
DATA
{% elif  issue.fields["Scrum Team"].value == "Benjamins" %}
ENG
{% elif  issue.fields["Scrum Team"].value == "CRAB" %}
ENG
{% elif  issue.fields["Scrum Team"].value == "Mint" %}
ENG
{%endif%}
 

Any thoughts?? Thanks! 

David Fischer
Community Champion
May 5, 2020

Hi Emily,

you're missing the double quotes around Squad on the first line (and maybe you meant to test the Scrum Team field instead?) 

Emily Lukasik
Contributor
May 6, 2020

Thank you.  I was missing the "" around the Squad field.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events