Forums

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

How to check the value of a field, whether it has changed or not with JMWE

RIZKY JTUASIKAL
Contributor
February 1, 2024

how can I make the Transition Issue feature work only when the value in a field remains the same as the previous one?

Example:

previously there was a field, named Need Risk, with a value of YES.

(Need Risk = YES)

Capture.PNG

 

 

 

Then what I want, there are the following condition:

if the value of the Need Risk field remains the same as the previous one (YES), 

and when I submit the status of the Draft PRF, the transition will go to the following transition:

 

Automate: Risk Criteria  (automatically.)

 

then the status can go directly to Under Review PRF, using the following Post Function:

 

d.PNG

 

and if the value in the Need Risk field changes from what was previously there (for example, the value becomes NO), then the next status will enter the Risk Pre-Assessment status.

 

 

 

but I don't know what the correct query is, for the Conditional Execution part.

s.PNG

 

Please help..

1 answer

1 accepted

1 vote
Answer accepted
Suprija Sirikonda _Appfire_
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.
February 1, 2024

Hi @RIZKY JTUASIKAL,

You can use the below Nunjucks script that returns true when the value of the field is "Yes"

{{ issue.fields.customfield_11000.value == "Yes" }} 

Replace 11000 with the ID of "Need Risk" 

If the "Need Risk" field is on the transition screen and you want to check in the post-function if the value of this field has changed on the transition screen, then you can add the below Nunjucks script in the Conditional Execution of JMWE Transition issue(s) post-function, that returns true if the value of the field was changed on the transition screen: 

{{ context.changelog.fields["customfield_11000"] }}

Replace 11000 with the ID of "Need Risk" field. If you want to use the above script, then the JMWE Transition issue(s) post-function must be placed after the “Update change history for an issue and store the issue in the database” built-in post-function.

I hope this helps!

BTW, I'm from Appfire, the vendor of JMWE app. A support ticket has been created in our support portal for this case: SUPPORT-166844. However, we couldn't add you as a reporter. We’d like you to sign up for our support portal here and let us know your username so that we can mark your ID as the reporter, and you will be able to access the ticket.

If the above solution doesn't work for you or your requirement is different, please feel free to share it on the support ticket.

Regards,

Suprija | Appfire

 

RIZKY JTUASIKAL
Contributor
February 1, 2024

Hi @Suprija Sirikonda _Appfire_ ,

 

Thank you for the answer...

for this:
"If the "Need Risk" field is on the transition screen"

the Need Risk field is not on the transition screen.

 

Let's just say, before submitting the status from Draft PRF to Risk Pre-Assessment status, the Need Risk field already has a value of YES

 

Then, how is the query? Is there a solution for this? :(
if the Need Risk field, already has a value of YES, and is not on the transition screen

RIZKY JTUASIKAL
Contributor
February 1, 2024

w.PNG

Suprija Sirikonda _Appfire_
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.
February 1, 2024

Hi @RIZKY JTUASIKAL,

before submitting the status from Draft PRF to Risk Pre-Assessment status, the Need Risk field already has a value of YES 

if the Need Risk field, already has a value of YES, and is not on the transition screen

In that case, you can use the below first script shared in my earlier response: 

You can use the below Nunjucks script that returns true when the value of the field is "Yes"

{{ issue.fields.customfield_11000.value == "Yes" }} 

Replace 11000 with the ID of "Need Risk" 

Or do you want to check if the "Need Risk" field was changed at least once on the ticket?

Regards,

Suprija | Appfire

RIZKY JTUASIKAL
Contributor
February 1, 2024

Hi @Suprija Sirikonda _Appfire_ ,

 

Sorry I forgot to explain this to you,

for the value in the Need Risk field, the value can be either YES or NO, right from the start..

w.PNG

Is it possible, if there is no change in the Need Risk field, then when submitting the Draft PRF status, the status will go directly to Under Review PRF (using the Transition Issue feature),

Capture.PNG

but if there is a change in the value of the Need Risk field, then when submitting the Draft PRF status, the status will go to Risk Pre-Assessment.

 

 

 

 

Sorry to trouble you with my questions, I'm still learning to use JMWE (it's new to me)

 

Reshma Begum {Appfire}
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.
February 1, 2024

Hi @RIZKY JTUASIKAL ,

No Problem! We are happy to help!

If you want to transition based on field value change, you must add 2 transition issue post functions.

1.  For: if there is no change in the Need Risk field:

Add a transition issue post function and select the transition Under Review PRF, add the below script in the conditional execution:

{{ issue | fieldHistory( "customfield_10080" ) | length <= 1}}

2. For:  if there is a change in the value of the Need Risk field:

Add a transition issue post function and select the transition Under Review PRF, add the below script in the conditional execution:

{{ issue | fieldHistory( "customfield_10080" ) | length > 1}}

Please modify the custom field of Need Risk accordingly.

Let us know if you have any questions.

Thanks,

Reshma

RIZKY JTUASIKAL
Contributor
February 14, 2024

Hi @Reshma Begum {Appfire} ,

 

Sorry for the late reply,

I've tried the above method, and it works.

and thank you very much for your help, I really appreciate it.

Suggest an answer

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

Atlassian Community Events