Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is there a way to overwrite the summary with a custom field value on create with scriptrunner

Scott Federman February 2, 2022

I am trying to enforce a standard naming convention on JSM tickets and so I have the ticket summary hidden and populated with a default text. At the time of creation, you are required to fill out the custom field  "Employee Name". I would like the employee's name appended to the front of the summary. Is there a script that I can run to do this?

1 answer

1 accepted

2 votes
Answer accepted
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 2, 2022

Hi @Scott Federman - If you want this to be done with script runner, I'll have to defer to someone else in the community, but this can be accomplished with automation:

  • TRIGGER: Issue Created
  • ACTION: Edit Issue
    • Summary:  {{issue."Employee Name".displayName}} {{issue.summary}}

Note - This assumes you're using a user field for Employee Name.  If you're simply capturing as a text field, you can omit the ".displayName" portion

Scott Federman February 2, 2022

Hey @Mark Segall I have no problem doing this with automation. The field is a standard text field, however. I have tried the formula above only it also accounts for the issue type and unfortunately I have had no luck.  

I end up with the followingcomp change.JPG

 

I use these settings

Automation settings.JPG

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 2, 2022

You may need to put employee name in quotes:

{{issue."employee name"}} - {{issue.summary}}

If that doesn't work, I typically go with the actual custom field ID which would look something like this:

{{issue.customfield_xxxxx}} - {{issue.summary}}
Scott Federman February 2, 2022

@Mark Segall bingo good sir. It needed the custom field id. Thank you!

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 2, 2022

Excellent.  Happy to help

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, ace, atlassian community event, donation, girls who code, women in tech, malala fund, plan international, kudos, community badge, badge, atlassian badge, International Women’s month, International Women’s Day, women's month, women's day

10 for Change at Atlassian Community Events

Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!

Join an Atlassian Community Event!
AUG Leaders

Upcoming Jira Service Management Events