Hello,
I am trying to build an automation that sends an email what the story points on a ticket are updated. I have a smart value set up with the current value in the story point field but is there any way to have the old value in the email as well? Would be helpful to know within the email what it changed from.
Thanks.
Hi, @Ben Weisman - yup, just use the fieldChange element.
My sample rule is just sending the info to the audit log, but it's the same format in a rule that uses the email action instead.
Documentation here: https://support.atlassian.com/jira-software-cloud/docs/smart-values-general/
Hi @Ben Weisman
Yes, and...to what Esther suggestions:
Just in case the field was empty (or gets cleared), you could add some default handling. For example, add the pipe symbol followed by a default value of the word EMPTY for the original value:
{{fieldChange.fromString|EMPTY}}
Kind regards,Bill
Thank you guys for the suggestion.
Hope everyone having a nice Sunday.
@Ben Weisman thanks for posting this query as this is exactly what I was looking for
Thanks for the solution @Esther Strom & @Bill Sheboy
I am using the Send Email trigger and in my email content I have kept as below
Previous value: {{#changelog.Release}}{{fromString|EMPTY}}{{/}}Current value: {{#changelog.Release}}{{toString|EMPTY}}{{/}}
It is working all fine except when the Release field is cleared, the email content reads as
Previous value: Release 1Current value:
Is there a way to display None as opposed to blank when the Release field is cleared?
Thanks,
Troy
Hi Troy, and welcome to the Atlassian Community!
You may be able to do that with the rule conditional logic. However there is no "Send Email Trigger", although there is an action for that, and so...
Please post images of your complete rule and the audit log details. Those will provided context for the community to offer ideas.
Thanks for your response, Bill.Please see screenshots below for the complete rule and email action, nothing on the audit log to share
Thanks for that information. As the current value is the one not working, perhaps just use the current value and conditional logic, like this:
Current value: {{issue.NBIP Release}}{{#if(issue.NBIP Release.isEmpty)}}None{{/}}
Both parts appear to be needed when a field has ever contained a value, as it will not be null for default handling in the future.
HI @Bill Sheboy I am in a company-managed JIRA project.
The custom field "NBIT Release” is having type= Select List (Single Choice)
I tested the rule with a dummy ticket, so when I selected current value as Release 3, got the below result
current value: [Release 3]length of the value:
and when I cleared the field like then got the below result
current value: []length of the value:
Hi @Troy
Sorry this thread is splitting/scattering. This is one of the reasons why it is better to create your own question and link back to other, related ones: less chance of other questions getting asked in the middle of the discussion :^)
Okay, it appears to me that {{changelog}} is one of those smart values which appears to be dynamically populated, and so doesn't work with all the functions of rules. That makes sense as it is probably filled in just-in-time from the issue history.
So the work-around for this use case is to capture the {{fromString}} first and then use it. For example:
This will return either None or your previous value. Please try that to see how it helps.
Hey @Bill Sheboy thanks for that create variable pointer, working like a charm now
I created one more variable to store the current value as well and used the below in my email body:
Previous value: {{#if(varPreviousValue.length().lte(0))}}None{{/}}{{varPreviousValue}}Current Value: {{#if(varCurrentValue.length().lte(0))}}None{{/}}{{varCurrentValue}}
many thanks for your support mate 👍
Hi @Bill Sheboy hope you are well.
Please can you check my query here How do I display previous value of Fix versions fi... (atlassian.com) ? I am hoping you can provide a solution like last time Thanks!
Hi @Bill Sheboy , I m looking for somewhat similar usecase and i think you should be the right person providing me a solution.
I have a custom date field , I need to use automation which will add a label once any of the member changes the date manually but only for the second time so as to then add the label as Re-Planned , but for all my tries the label is getting added even for the first time when someone selects a date from empty state .(want the label to be added only when its changed second time) Can you please guide me the automation rule here may be using smart values ? Thanks!
Hi @Vicky S -- Welcome to the Atlassian Community!
First thing: this is a older thread, and so I recommend creating a new question, and perhaps linking back to this one. That will ensure the maximum number of people see it to offer help.
When you create the new question:
Without seeing your rule, your scenario may need adjustments to the conditions or a "counter field" to track the changes. The specifics will depend on your rule and field.
Thanks, and kind Regards,Bill
Thanks @Bill Sheboy , here is the new question link - https://community.atlassian.com/t5/Jira-Software-questions/How-to-trigger-automation-action-only-when-the-date-field-is/qaq-p/2659182
It looks like you're new here. Sign in or register to get started.