Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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 to add smart value in the hidden summary field of an issue using the the post functions script

Hello,

I'm trying to automatically create a "Summary" based on a CustomField selected by the creator. 

"[POOL] - Deletion requested" where [POOL] is the value selected by the creator of the ticket - this is a multi-choice "Labels" type field.

The Summary field is hidden to the creator.

We are trying to use the following Jython post function script:

from com.atlassian.jira.component import ComponentAccessor

customFieldManager = ComponentAccessor.getCustomFieldManager()
poolCustomField = customFieldManager.getCustomFieldObject(12314)
pool = issue.getCustomFieldValue(poolCustomField)

issue.setSummary("[" + pool + "] - Deletion requested")

but I am getting an error when creating the ticket.

1. is it because the field is a multi-choice label field?

2. is it possible to use a smart value in such a Jython script, if yes - how?

I've successfully used the smart value {{Issue.fields.customfield_12314}} in the same ticket creation so the CF exists.

Thank you for your help.

Marta

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

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