how to get values of a summary field

MoinP December 18, 2014

Team ,

I am trying to write a script for a field behavior in JIRA. As part of which I am trying to fetch the Summary ( system field ) value from a JIRA ticket. But as result the value in log shows a Null value for Summary.

I tried using below but know luck.

-- FormField ExtractType = getFieldById("summary")

-- FormField ExtractType = getFieldByName("summary")

Can someone help me to show how to get values of a summary field.

Thanks.

4 answers

0 votes
Ali Bugra Topcuoglu November 7, 2020

You can get summary like this;

underlyingIssue?.summary

 

0 votes
MoinP December 19, 2014

Jamie ,

Can you please guide us on this issue ?

 

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 19, 2014

> On which field have you attached this script? Please answer my question.

Bob November 6, 2017

Hi Moin, or Jamie - did anything ever come of this question? 

 

I believe I am having the same problem, my code is as so: 

import com.atlassian.jira.component.ComponentAccessor

def summary = getFieldById("summary")

summary.setHelpText ("Summary is: "+getFieldByName("Summary").getFormValue())

 I have tried a range of syntax:

getFieldByName("Summary").getFormValue()

getFieldById("summary").getFormValue()

getFieldByName("Summary").getValue()

getFieldById("summary").getValue()

Unfortunately in all cases my help text simply states the summary is Null, even when editing a ticket which has a summary set. 

 

Any help would be greatly appreciated

Naveen April 27, 2018

@Bob

Did you had any success in making above code work?

0 votes
MoinP December 18, 2014

No we don't have any Summary custom field. We are using Summary system field only.

We even tried this with other system fields but getting the same error - Null value

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 18, 2014

It's:

getFieldById("summary"

or

getFieldByName("Summary")

Once you have the field, you call getFormValue() on it to get the actual summary. On which field have you attached this script?

MoinP December 18, 2014

Thanks Jamie ,

We are using a Text field for this script.

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 18, 2014

Summary is the name of the system summary field. Do you have a a custom field called Summary?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events