Copy certain text from summary into a custom field

harsh.bhardwaj January 15, 2021

Hi,

I need help in copying a certain text from summary of an issue to a custom field in JIRA Cloud.

For Eg: 

Summary : "Report of Oct 2020 :: Company ABC"

I wanted to store "Company ABC" in a certain custom field.

I am using : "Email this issue" plugin and Automation plugin. 

1 answer

1 accepted

1 vote
Answer accepted
Alexis Robert
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 15, 2021

Hi @harsh.bhardwaj , 

 

you can achieve this with Automation for Jira using Smart Values :

  • Create a new rule
  • Select "Issue Created" as a trigger
  • Set a new action to "Edit Issue"
  • Select the field you need to copy your text to, and use this value : {{issue.summary.replaceAll(".*::","")}}

Have a look at the screenshot of my rule, I just tested it and it works fine :

Screenshot 2021-01-15 at 12.17.07.png

 

Let me know if this helps, 

 

--Alexis

harsh.bhardwaj January 15, 2021

Thanks you so much @Alexis Robert . It is working for me, cheers.

Daniyal Anas March 17, 2022

Hi, @Alexis Robert

I hope you're well! This is incredibly helpful! Is there a way for me to select a segment of the summary to parse into a custom field, as opposed to including the entire summary?

Looking to for something like this:

Account Lockout: UserID: aedana, UPN dan.anas@techmd.solutions

I need to extract the trailing text after UPN, to be parsed into customfield User Principal Name.

 Your advice is immensely appreciated!

Dan A.

Like # people like this
Chris Carruthers November 24, 2022

{{issue.summary.replaceAll(".*UPN ","")}}

The solution is showing you how to include all characters after the string. The star at the front means it doesn't matter what's in front, it just cares about what's after the start (for you, UPN)

Diana C November 29, 2022

Hi!

What would the format be if I wanted to pull out a string that's inside other text?

Say I had the following text:

"The user's email is: user@example.com and this relates to ticket ABC-123."

I want to pull out the "user@example.com" and feed that string into a dedicated "email" field on the ticket.

So far I have: {{issue.description.replaceAll(".*is: ","")}}

--

UPDATE: This has been figured out. We were able to successfully use the following to pull an email address out of the "description" field of a ticket to populate a dedicated "email" field:

{{issue.description.match("([a-zA-Z0-9+._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)")}}
Idiyana Binti Ahmad Salim March 6, 2023

Hi,

How can i copy all text from trigger issue's summary then add few words at the front/back of the summary in a custom field?

example like this:

summary = Hello world

additional text = Test

value in custom field = Test Hello world or Hello world Test

Like Tracey Prather likes this

Suggest an answer

Log in or Sign up to answer