Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I access with groovy the subtasks of linked issues?

We are working with Jira Server and JMWE plugin.

We have created an issue type that stand in the hierarchy above the epic- what means this issue type "abc" hast always more than one linked Epic inside.

Now we have a transition in epic workflow to sum up all storypoints from all issues inside the epics.

Also we have a transition to sum up all storypoints of all linked epic.

But always you have to update first the epic and after you can make the update in abc

My question is: Is there a possibility to make it in one step out of abc?

Is it possible to access the subtasks of linked issues?

 

4 answers

2 accepted

Hi @Anita Hütter ,

Using JMWE, to set the Story Points field value of an issuetype(say "abc") to sum of the Story Points field value of all the tickets which belong to the Epics linked to the "abc" issue : 

  • Add a “Set field value (JMWE app)” post-function on the desired transition of the "abc" issuetype
  • Select “Story Points” field
  • Select “Value Type” as “Groovy Expression” and add the below Value :
issue.linkedIssues.findAll{it.issueType.name == "Epic"}.stories.sum{ it.sum {it.get("customfield_10006", 0)} }

Replace customfield_10006 with the id of "Story Points" field.

The above script finds the Epics linked to the current issue(through any link type) and sums the Story Points value of all tickets which belong to the Epics.

JMWE.png

 

We have opened a support ticket in our customer portal, https://innovalog.atlassian.net/servicedesk/customer/portal/8/SJMWE-2663 to better track your request and added you as the reporter for that ticket. Please access the ticket and make sure that it is accurately showing you as the reporter.

If you need us to make any changes to the reporter field or unable to access the ticket, please let us know here in this thread.

 

Thanks,

Suprija

0 votes
Answer accepted

Thank you very much for your help!

You are welcome!

-Suprija

0 votes

Please remember, when you are looking at the sub-tasks, putting estimates on them breaks your sprint and stops you doing them.  It's fine to put story points or estimates on sub-tasks, as long as you do not use them for the sprint estimation statistic.

Hello Suprija, how can it be that your script

issue.linkedIssues.findAll{it.issueType.name == "Epic"}.stories.sum{ it.sum {it.get("customfield_10006", 0)} }

runs good in our test instance but causes the following exception in the other:

Message:
groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.Double#plus.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
 [class java.lang.Character]
 [class java.lang.String]
 [class java.lang.Number]

Different versions of Jira or Java on the two systems are the most likely cause of this, although it may also be down to different code in an app, if the code is looking at app data.

in the one instance we have JMWE 6.4.0 -> hats where the script is working

in the other instance ( where I need it to be running) we have JMWE 6.6.1 - here it doesnt run

I believe the script should be:

issue.linkedIssues.findAll{it.issueType.name == "Epic"}.sum{it.stories.sum{it.get("customfield_10006", 0)} ?: 0 }
Like # people like this

After first tests it looks good. Thank you very much for your help!

 

Its working with both versions of JMWE thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

203 views 6 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you