how to get values of a summary field

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.

3 answers

This widget could not be displayed.

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?

Thanks Jamie ,

We are using a Text field for this script.

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

This widget could not be displayed.

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

This widget could not be displayed.

Jamie ,

Can you please guide us on this issue ?

 

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

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

@Bob

Did you had any success in making above code work?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

515 views 3 18
Read article

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