Forums

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

Using a Nunjuck script in a POST function to change a custom field value

David B
Contributor
August 16, 2025

I am trying to modify a work flow to set the Request Type to a specific type on creation of a new work item based on a value that gets passed from the trigger issue : 

{% if (issue.fields["QA Score"] | default(0)) < 100 and (issue.fields["QA Score"] | default(0)) > 89 %}


{{issue.fields["Request Type"].requestType.name}} = "QA: Minor"


{% endif %}

That's what I am trying to use and maybe there is a better way to do this and would love some input on this.

2 answers

0 votes
John Funk
Community Champion
August 16, 2025

Hi David,

Are you using JMWE? Is there a reason you are trying to use a Post Function instead of an Automation rule? 

David B
Contributor
August 18, 2025

If you are referring to Automation in Jira, I want to try and avoid using that because I do not know how many times it would run in a month and I do not want to burn through our monthly allotment.

 

We are using JMWE but it did not seem to be working for some reason, turns out the reason was me. I had to change the Run As setting on the JMWE rule and it worked fine.

 

Also thanks for the reply John!

Like John Funk likes this
John Funk
Community Champion
August 19, 2025

Great! Glad to hear you got it working!

 

Like David B likes this
0 votes
Oleksii Melnyk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 16, 2025

Hi @David B
I think you can use Jira Automation.

Just use Work item fields condition.
Select QA Score less then 100 change request type (via JSON edit) to QA: Minor.

David B
Contributor
August 18, 2025

Oleksii - I am a little confused by what you mean but it turns out I was able to do it with JMWE once I resolved my own user error :) Thank you for the reply.

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