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)
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:
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.
Please help..
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
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
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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..
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),
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.