You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi Community,
I try to count issue type story through an automation.
For example:
Actions:
1. When I create one issuetype = story the custome field (Correlative) is equal to 1
2. When I create other issuetype = task the custome field (Correlative) is equal to 1
3. When I create one issuetype = story the custome field (Correlative) is equal to 2
Because I created two story (Action 1 and 2)
Hi Marco,
I think I understand what you are trying to do here, I have put together an automation rule example, that I think might meet your criteria here. Check it out:
In my example, I have a numeric field called NewNum. My trigger is upon issue creation. This is also a project specific automation rule (not a global or multi-project rule). By doing a Lookup issues and then choosing the JQL of
NewNum is not EMPTY ORDER BY key desc
This way automation will do a JQL query to return the issues in this project that have some value for that custom field, and order them from most recently created to oldest, since Jira increments the issue keys when new issues are created.
From there I do a re-fetch data, just to make sure we give the lookup enough time to gather that info, before you can then do an edit issue action to set the NewNum on the newly create issue. I used the smart value of
{{lookupIssues.get(0).NewNum.plus(1)}}
To look at the first entry of the JQL lookup (0 being the first indexed issue), you can use the get(0) along with the custom field name, and then we can use a simple math operation of plus(1) to increment the other issue's value and store it to that field.
This method should allow you to have potentially deleted issues in the project and still new issues will lookup the most recently created issue and use that issues field value when determining the next number to use.
Does this help?
Andy
:OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
I think it's exactly what I was looking for. I'll give it a week's trial and I'll confirm.
Thanks @Andy Heinzer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Andy Heinzer - @Trudy Claspill
Now I have the following problem
How can I give the following value to the tickets that did not take the correlative value and that have already been created?
MAR1-632 -> Correlative = 2
MAR1-633-> Correlative = 3
and the next keys...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Those issue were created months ago, so the automation trigger of when issue is created won't be able to change those now. In that case, there are a couple of different ways to go about it.
One approach would be to create a new automation rule. You could copy the existing rule, but just change trigger from "Issue Creation" to some other trigger, such as "Edit issue" in which case the next time someone edits the issue it can update that field. If you choose this route, you will want to add a condition check in the automation rule so that before making a change to the issue, check to see if the correlative field is empty. Without that condition check, each edit to the issues would push that custom field value ever higher.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there a way to change MAR1-632 -> Correlative = 2 MAR 1-633-> Correlative = 3 massively?
I mean change the trigger (not when editing but something like calendar or something like that that can run immediately)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can create a new rule to manage existing issues and update them with new values for this number field.
Note that I changed the trigger to happen on Issue updated. Also there is a conditional to check that this field is currently empty. Once those two are there I adjusted the JQL query to lookup the highest number and increment that value by one. The JQL for that in my example was:
NewNum is not EMPTY order by NewNum desc
This way, any user that edits/updates these existing issues will trigger automation to assign a value to those issues based on the issue with the highest value at the time of that edit. Provided that the issues do not have a value for that field yet.
I hope that helps.
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Andy Heinzer
Sorry for the delay in my response but what you indicate does not work for me, I will try to explain myself better.
Tickets 632 and 633 are finished tickets so they will not be edited again. I am looking for an automation (for example, the calendar ones that can be run to confirm that everything is working) that allows me to update these tickets that are in Done and that will no longer be updated.
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 update. Sorry that this solution doesn't meet the need here. However trying to use a scheduled trigger that can search JQL isn't really an ideal approach here.
That is because the actions taken in such an automation rule will have to apply to all the JQL search results equally. Since we want to apply a different value (an increment) to each of the issues that are missing a value in this field, a scheduled automation rule really aren't well suited to see the correlated number and apply a correctly incremented value to all those issues in a single action. Instead you would likely end up with issues having duplicate values for that correlation field.
That said, the previously suggested approach to set for a single issue at a time is going to be more accurate in seeing what the previous correlation value was and then using that value in the next issue to set. Having two rules to this, one for issue creation, and another for managing the existing issues I believe is more feasible.
You are not required to use the 'Issue edited' as a trigger though in that second rule. You could just use something like the Manual trigger instead. However for a manual trigger, you would then still need to go to that issue, and select that automation to run on that issue in order for automation to be able to set the value.
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.
Hello @Marcelo Ignacio Cid Abud
What problem are you trying to solve by keeping track of how many issues of each type exist?
How do you need to use that information?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Because en Jira Service Management the corralative number of tickets has a problem.
I read in other foro that problem is in Jira (company) not the work space. For that I need one automation that coun the issuetype create.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Marcelo,
I don't think I understand your use case. In which issue do you want to record this information? Can you walk through the details of an example scenario? Providing screen images to illustrate your example would also be helpful.
If English is not your native language also feel free to use your native language and I will use a translator. Sometimes there is a misunderstanding due to language differences.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tell you @Trudy Claspill ,
I have a custom field called Correlative, this field is a numeric field.
What I want to achieve is that each time a ticket is created, this field increases, that is, when I create a ticket it takes the value of 1, when I create another ticket it takes the value 2, when I create another ticket the value 3, and so on. successively
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you want to count issues in a specific project? Or all issues created in all projects?
It sounds like you want to record the count of issues in every issue.
1. Create one story (ABC-1)
In ABC-1 set field Correlative to 1
2. Create another story (ABC-2)
In ABC-1 set field Correlative to 2
In ABC-2 set field Correlative to 2
3. Create a Task (ABC-3)
In ABC-3 set field Correlative to 1
4. Create another Task (ABC-4)
In ABC-4 set field Correlative to 2
In ABC-3 set field Correlative to 2
5. Create another Story (ABC-5)
In ABC-1 set field Correlative to 3
In ABC-2 set field Correlative to 3
In ABC-5 set field Correlative to 3
If that is not a valid representation of what you want to do, please provide a detailed example such as I have tried to do.
Is there some relationship between the issues besides having the same issue type? Is this per project or across all projects? Is it for all issue types? Or are you trying to count linked issues for each issue?
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 answer @Trudy Claspill
but no :C.
1. Create one story (ABC-1)
In ABC-1 set field Correlative to 1
2. Create another story (ABC-2)
In ABC-1 set field Correlative to 1
In ABC-2 set field Correlative to 2
3. Create a Task (ABC-3)
In ABC-3 set field Correlative to 3
4. Create another Task (ABC-4)
In ABC-4 set field Correlative to 4
In ABC-3 set field Correlative to 3
5. Create another Story (ABC-5)
In ABC-1 set field Correlative to 1
In ABC-2 set field Correlative to 2
In ABC-5 set field Correlative to 5
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see. Thank you for that clarification.
The number portion of the issue ID (ABC-5) already provides that information.
Is there a reason you need that information stored in the issue separately?
If you really do need that, then you could set the field through an Automation Rule using this structure:
TRIGGER: When issue created
ACTION: Lookup Issues Action
JQL: project={{issue.project}}
ACTION: Edit issue
Field to edit: Correlative
Value: {{lookupIssues.size}}
The Lookup Issues action looks up all the issue in the same project as the one created. If you only want to count Tasks and Stories (i.e not Epics and Sub-tasks) refine the JQL accordingly.
The smart value {{lookupIssues.size}} is the number of issues found by the last Lookup Issues action.
Note that the Lookup Issues action has a limit of retrieving 100 issues. Are you expecting to have more than 100 issues in the project at some point?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I expect to have more than 100 problems, I would even say more than 1000.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Then use this smart value to get the numeric portion of the issue key and set that into your Correlative field.
{{issue.key.substringAfterLast("-")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good Moorning (in my country)
It´s work but I need this for the problem in service mangement.
https://jira.atlassian.com/browse/JRACLOUD-59371
https://jira.atlassian.com/browse/JRACLOUD-77334
For that I need generate a new "Correlative"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you need to accommodate the situation where the numeric part of the issue key has not incremented sequentially, the only other option I can think of is that you would need to use the REST API to get the issue count.
The API call is explained here:
You would access the API using the Web Request action.
https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Send-web-request
There is an article on using the Web Request action here:
I have not worked with that specific action before. If you have questions about it I recommend that you start a new Question thread about that specifically so that other community members with knowledge will see that as a new topic and offer their guidance. They would not see the question about it if they were only buried in this existing Question. If you decide to try that action and start a new Question about it, put in that Question a link to this post to provide background information without having to re-enter everything we've discussed here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I understand but
Exist the possibility that I have the ultime issue created ?
For example:
Today I am going to create a ticket (ABC-3234) and I want to give a value to the correlative field but I want that value to be greater than the last ticket I create (ABC-3233) which has a value of 5, that is, when I create the ticket ABC-3234 the value that the correlative field must have is 6.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think I understand your requirement.
I thought the requirement was to set the Correlative field to the current total number of issues in the project including the issue that is being created.
Now it sounds like you want to set the field to be one more than the highest number used in that field in all the project issues.
Please try again to explain what information you want to use to determine the value to set for the Correlative field in the newly created issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Marcelo Ignacio Cid Abud
I think there may be some confusion because of differences in our native languages.
Can you please try posting in your native language, so that we can user translators to see if we understand more clearly?
Also, can you please try to explain the problem you are trying to solve rather than the change you are trying to implement? Why are you trying to record this number in each newly created issue? How will the data be used? If we understand the actual problem you are trying to solve we may be able to give you better advice.
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.