I'm looking at how I can create an automation that calculates SP based upon the task complexity field (easy, medium, hard) and the time tracking field native to Jira. Task complexity is a custom field (10347) and it time tracking is in hours.
Still pretty new to this, but basically what I started off with was this:
{{#=}} {{#if(issue.customfield_10347.equals("Easy"))}} {{issue.timeTracking.timeSpent / 8}} {{/}} {{#if(issue.customfield_10347.equals("Medium"))}} {{issue.timeTracking.timeSpent / 8 * 2}} {{/}} {{#if(issue.customfield_10347.equals("Hard"))}} {{issue.timeTracking.timeSpent / 8 * 3}} {{/}} 0 {{/}}
What I believe is happening is that the custom field is more or less failing and then i default into 0 SP.
Though I do not recommend translating quantified-measures to relative-sizing ones, you may want to try using a Lookup Table rather than a complicated conditional expression. That will be much easier to maintain and understand. Please look here to learn more:
To your original question, select-option fields provide the option id as the default, rather than the value attribute, and so your expression was trying to compare something like "2" to "Easy". If you add the value attribute and improve the test, I suspect that expression would work. Also, it is unclear if you wanted that trailing 0 at the end to be in the front instead.
{{#if(equals(issue.customfield_10347.value, "Easy"))}} ... {{/}}
Kind regards,
Bill
You should round the values, up or down. A value of 2.5 story points may not work.
Look for round, ceil, floor https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
I don’t think this is the issue here as I can apply decimal values to the story point field. It looks like when I log the custom field it displays nothing which is strange as it should display the value from the dropdown value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think i will opt to use "if" components in the automation itself. it seems to be working and might just be an easier, but less elegant solution in this case.
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.