Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to add smart value in the hidden summary field of an issue using the the post functions script

Marta Rogalinska
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 10, 2022

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