How can I get summary data from JIRA using groovy scripting.

Can you please help me in getting Summary Data from JIRA using Groovy Scripting.

2 answers

0 vote
Alexey Matveev Community Champion Jan 03, 2018

Hello,

Do you mean that you have Adaptivist ScriptRunner add-on and you want to get the issue summary in a post-function or validator? If so, it would be like this

issue.summary

Thanks for the above code Alexey.

yeah, I use Adaptivist ScriptRunner add-on.

Here I need to fetch summary from one Issue Type and display it in different Issue Type. For example - I need to fetch summary data from Bug and display it in Task Issue Type.

In this case, issue.summary wont get the required data.

Alexey Matveev Community Champion Jan 03, 2018

the field summary is defined for the issue object not for issue types. Do you want to say that you want to copy the summary field from one issue to another? On what event do you want to copy it?

Yes exactly, I need to copy the summary field from one issue to another.

Let me explain you with an example, If i have linked issue type bug to Task, then i need to see Bug's summary data in Task type home screen. I hope i am not confusing you.

Alexey Matveev Community Champion Jan 03, 2018

What is your Jira version? And in what custom field of the Task issue you want to see the summary of the Bug issue?

Moreover I guess you can see now the summary of the Bug issue in the link web panel of the Task Issue. I mean when you enter the detailed view of the Task issue you can see the linked issues with the Task issue and you can see there the summaries of the linked issues. Why it is not enough?

I use JIRA v7.2.2. I need to view the Summary of Bug in Scripted Field under Task issue.

But we have a requirement from Client to display the Summary using Scripted Field only

Jeevan, I don't have the time to write and test code for you.  Here are suggestions to get you going:

Take a look at the methods in IssueLinkUtil, probably getLinkCollection, to access the links for the Task issue. 

Find the Bug issue by searching the LinkCollection. Return the Bug issue summary as the result of the scripted field

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

211 views 1 18
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you