I want to automate the steps to count and generate a sum of a specific custom field. The custom field is a single select list. There is a secondary custom field to contain the sum.
This is the automation rule as I have tried it so far:
Trigger: When Value changes for (name of custom field), then Change Type is Value added.
The For field is left blank >
Then: Edit issue fields, choose secondary field that will hold the sum with this value:
value= {{issue.customfield_10241.size}}
Unfortunately, nothing happens after that, no sum, no total, nada...
Pls let me know if you've got a resolution.
HI @Elizabeth Pfotzer - There are a few pieces to this that I need to understand:
I want to automate the steps to count and generate a sum of a specific custom field.
Is this across a number of issues or does the custom field have options that are captured in an array of some sort (e.g. 1, 2, 3, 4)?
Then: Edit issue fields, choose secondary field that will hold the sum with this value:
value= {{issue.customfield_10241.size}}
This is not how the edit issues action works or the way the size smart value works. Edit issues would simply be {{issue.custom_field_10241.size}}. However, size is intended to provide a count of an array (hence my first question for clarity). For example, I use the lookup issues action and use {{lookupIssues.size}} to get the count of how many issues were returned by the lookup issues action.
@Mark Segall - thanks very much for your reply. To try to clarify for you, I have a CSV file that has a a heading "Component" which refers to the component of a vehicle. I am attempting to count the number of each different component that is uploaded through the external system upload. For instance, if "Oil Cooler" occurs 300 times in the CSV file, I want to quantify that number and be able view it in the custom field called Component Count field in Jira. Ultimately, I want to create a filter and display it on the dashboard.
I created the single select dropdown custom field called "TEST - For Component Count" that has the names of the components so that when a new issue is created, the name of the component is selected from that field and the count would then go into the Component Count field.
I hope this is clear?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the additional clarity... Do each of the rows in the csv correlate to an individual Jira Issue or does each issue get its own csv?
If the former, you probably want to create a "master issue" for each component that stores the total count. You could do something like this:
If each issue gets its own csv, you'd probably want to explore upgrading JSM to Premium so you can take advantage of Asset Management.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Elizabeth,
When you set the value for a custom field you should not include the "value = " part. I'm not sure where you got that from?
{{issue.customfield_10241.size}} should be sufficient. I never used "value ="
Perhaps using the Log action task will help you. With this task you can log something that will be visible in the log of your rule to make sure the number you are expecting is correct.
You should also clear the additional fields section because that field expects a json representation.
The name of the field you are setting is component count so I assume you want to display the number of selected components in a select list. And this is not the default components field from Jira?
Or is it an actual select list of numbers? In that case .size will not be the right method to use as @Mark Segall pointed out.
This is a working example where I set the number of selected components in the description of the ticket.
More info:
Documentation on math expressions: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/
And the one for lists: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/
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.