The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How to copy some part of description to other customfield

Janaki.R
Contributor
February 17, 2021

The tickets are getting created from mail handler and there will be some data in the description, instead of all the data we wanted to copy only email address present in the description to other custom field.description.PNG

2 answers

2 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
David Fischer
Community Champion
February 18, 2021

You can indeed achieve this using our JMWE app's Set Field Value post-function on the Create transition.

For that, you need to set "value type" to "Groovy Expression" and use a regular expression to extract the email address from the description. Something like:

def match = issue.get("description") =~ /(?mi)Email: (.+)/
match.groupCount() ? match[0][1] : null
Janaki.R
Contributor
February 18, 2021

Thanks David, It is working for me

Cesar Duran
June 12, 2023

Hi David, is it possible to do this in Cloud?

0 votes
Answer accepted
Ivan Lima
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
February 17, 2021

Hi @Janaki.R, you definitely need an app to achieve that. I've done something similar using ScriptRunner, but I'm sure you can find other apps that can help you as well. It depends on your experience with scripts and how variable your template description string can be. That said, which app are you currently using?

JANAKI RACHAKONDA
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!
February 17, 2021

We have script runner and JMWE addon, tried with automation also but I am missing something where unable to achieve the exact output 

Ivan Lima
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
February 18, 2021

Well, I'd say you're well equipped. You can give it a try based on David's suggestion. Also, if you can, it would be helpful to share the snippet you're working on so that we can better assist you here.