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.
Dear Atlassian community,
I've build a counter with scriptrunner, with the following code:
import com.atlassian.jira.component.ComponentAccessor
ComponentAccessor.getIssueLinkManager().getLinkCollection(issue, issue.reporter)
.getAllIssues().count {
it.getIssueType().getName() == "Incident"
}
.toString()
What this counter is doing it count all related issues with IssueType "Incident".
But how can I extend this that my counter only count the issues with issuetype "incident" that are unresolved? So with resolution = unresolved?
Thank you in advance if somebody can help
Best Regards,
Hello @wvorigin
Like this :
import com.atlassian.jira.component.ComponentAccessor
ComponentAccessor.getIssueLinkManager().getLinkCollection(issue, issue.reporter)
.getAllIssues().count {
it.getIssueType().getName() == "Incident" && issue.resolution == null
}
.toString()
Hello @Mark Markov,
Thank you for your reply.
The code is accepted, only it still count related issues that have a resolution as well.
So there is no different situation as my original counter.
Any other idea?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My bad, ive made mistake in condition, tryed to equals issue resolution instead of link issue :)
Here is right version
import com.atlassian.jira.component.ComponentAccessor
ComponentAccessor.getIssueLinkManager().getLinkCollection(issue, issue.reporter)
.getAllIssues().count {
it.getIssueType().getName() == "Incident" && it.resolution == null
}
.toString()
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.
You re welcome! If it helps you please mark answer as accepted :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I made a number type custom field named PlanPercent. I I would like to update the percentage value by counting the issues whose status of the linked issue type is Hierarchy link (WBSGantt) and whose status is Completed. If issue A has 5 Hierarchy link (WBSGantt) linked issues, and 3 linked issues are Completed, percentage value must be 60. It is calculated by 3/5* 100.
Can you give me groovy script?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One question here
I am looking similar thing to have counter so any time issue gets related to other tickets counter field show number of tickets related on the ticket itself.
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.