When performing calculations using fields, is it required to add "issue." prior to the field?
I was getting some random values in calculation results and trying to figure out why.
For example:
should this work without issue?
{{#=}} {{addamonth}} * {{Monthly Approved Budget}} {{/}}
Or do I need to add "issue." prior to the field?
{{#=}} {{addamonth}} * {{issue.Monthly Approved Budget}} {{/}}
Hello @Madar_ Andrew
Is it required? - No.
it is implied that you are referencing the issue at hand.
But this "issue at hand"'s context is important for you to know.
When you are on main path, {{issue}} refers to trigger issue.
When inside a branch, {{issue}} refers to issues found based on your branch criteria. So in that case, if you want to reference issue which triggered the rule, you use {{triggerissue}}
If you have created an issue as part of your step, to refer to fields of this created issue, you use {{createdIssue.field}}.
So as you see, depending on where you are, what issue you want to reference, this keyword may be needed.
Please share screenshot if you are stuck. Hope it helps. Thanks.
I am using the IF branch, and performing the calculations on this branch. Would I be required to use the issue or triggerissue prefix?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, and...to Kalyan's ideas:
Context is important for automation rules, and so let's look at an example rule to see which issue is "current" at different locations.
trigger: some trigger | At this point, "current issue", {{issue}}, and {{triggerIssue}} refer to the same thing. |
action: some action | same as above |
branch: on some issues | same as above |
action: an action inside the branch | Inside the branch, "current issue" and {{issue}} refer to the branched-to issue, but {{triggerIssue}} continues to be fixed. |
action: after the branch | After the branch, we are back to "current issue", {{issue}}, and {{triggerIssue}} refer to the same thing. |
Another thing to watch for is list iterators, where the top-level of the iterator decides what is needed. The issue prefix would rarely be needed for those cases. Please look here to see more examples of those: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/#Combined-function-examples
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For your rule, at least as far as shown:
So any of the 3 options above will give you the same result. It does not matter.
Now, if you are not seeing expected results, we have to look at your formulas.
So for that, you need to log all your values. So add below steps to your rule:
Once all added, run your rule and share your complete rule & audit log.
Thanks.
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.