Copy description text to custom field

MarcosQ June 19, 2017

Hi! We are trying to add part of the text from the Issue Description to a custom field.

 

Explanation: 

*When you set Jira mail handler to create issue via email, there is an option to set a " Default Reporter".  But this option does not allow to add the "legitimate" reporter as a watcher, or unless send him notifications of the issue updates.

 

Jira add in Description somethin like: "[Created via e-mail received from: username <username@email.com>]".

 

So we want to create a script to add part of that text (just the email between < >) on a custom field. Then we will notify the user via post-function with email this issue addon as "recipients stored in fields!. 

Thnaks in advance!
Marcos.

1 answer

0 votes
Steven F Behnke
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 Leaders.
June 19, 2017

Not possible out of the box.

Why don't you us the ability for JIRA to determine the user from the email? It should be an option instead of setting a default reporter.

MarcosQ June 19, 2017

Thanks for the reply Steven.

Because if the user does not exist on Jira, will create the account. We don't want that. 

We just need anonymous users to have the hability to create issues via email and get the notification when the issue is completed.

Steven F Behnke
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 Leaders.
June 19, 2017

Do you have any plugins to support this? Like ScriptRunner?

MarcosQ June 19, 2017

Yes, I do have scriptrunner.

jira guy
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 Leaders.
May 10, 2018

I am trying to do the same thing with script runner. @MarcosQ Were you able to achieve this?

Steven Behnke
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 Leaders.
May 10, 2018

To be honest, this is trivial. Write a regex to capture the email between the less than and greater than symbols, and then add that to a custom field and update the issue. This would be a Script Listener likely.

jira guy
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 Leaders.
May 11, 2018

I actually made this work in a similar way using an automation rule. 

 

Event: Issue Created

 

Edit Custom Field: Email Address

{{issue.description. substringBetween(" <",">]")}}

 

Now I want to send an Issue Created email to this email address, but this automation rule applies after the issue created event...

jira guy
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 Leaders.
May 14, 2018

Automation plugin also has publish event option which allowed me to send notifications. Script listener captured the event and sent notifications

 

Thanks All

Suggest an answer

Log in or Sign up to answer