Forums

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

Using automation to copy value from summary to custom field?

Patricia Johansson
Contributor
July 26, 2022

We have a project for access requests, and using dynamic templates we have created templates where the requester fills in details such as "user email". I would like to get this info copied from the summary to a field we have named "user email".

 

Using the command: 

{{issue.summary.substringBetween("","")}} 

This doesn't seem to be able to collect an email address, even if I surround it with ( ), or ' ' or set the rule to include the words before/after.

It seems it will only work on one word, for example:

Bitwarden Access
[rest of summary]
  • Rule ("B","n") gives me "itwarde"
  • Rule ("B","c") gives me none/blank (expected "itwarden A")

 

Is there a way to get a text like email address from the summary to a custom field?

2 answers

1 accepted

0 votes
Answer accepted
John Funk
Community Champion
July 26, 2022

Hi Patricia - Welcome to the Atlassian Community!

Do all of the emails end with .com? 

Patricia Johansson
Contributor
July 28, 2022

Hi John, they should yes :)

John Funk
Community Champion
July 28, 2022

Then maybe change it to ends with .com

Patricia Johansson
Contributor
August 1, 2022

So this is my issue that it won't return anything if there are spaces, special characters etc, as shown:

It seems it will only work on one word, for example:

Bitwarden Access
[rest of summary]
  • Rule ("B","n") gives me "itwarde"
  • Rule ("B","c") gives me none/blank (expected "itwarden A")

 

Even if I set the rule to be "{{issue.summary.substringAfter(":")}}" and change the summary so the user email is the first one with a : it still returns blankimage.png

Log on automation:
 image.png

John Funk
Community Champion
August 1, 2022

Well, it looks like there are too many limitations for what you are trying to do. You should probably create a custom field to capture the information when it is input. 

Patricia Johansson
Contributor
August 1, 2022

So there wouldn't be a possibility of collecting this info from the summary itself? As we do have a field already but want it to autofill from what's put into the summary. As we use templates it should always be in the same format

John Funk
Community Champion
August 1, 2022

Hmm, in your example above, you have issue.summary, but you show values in the Description field. Does your Summary field have the colon?

Like • Patricia Johansson likes this
Patricia Johansson
Contributor
August 1, 2022

Oh my...... You are right, I had confused the description with summary *facepalm.

 

Thanks! It's one of those things that the longer you stare at them the more blind you become

Like • 2 people like this
0 votes
Mark Segall
Community Champion
July 26, 2022

Hi @Patricia Johansson and welcome to the community!

Can you please provide a sample summary so we can see the full context?

Patricia Johansson
Contributor
July 28, 2022

Hi Mark and thank you!

Sure, so we use the templates for Jira and here is an example of one of our dynamic templates:

image.png

Summary would be something like this based on the above:

Bitwarden Access Request
----------------------------

Name: Test
User email: ' test@email.com '
Manager: Manager
Domain: Supply
Collections:

 

I've tried surrounding the email address with ( ), *'s, etc.

Even if the rule is set to 

{{issue.summary.substringBetween("email:","Manager")}} 

and no other formatting is added to the email address it always returns blank 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, likes for trees, atlassian community, social impact, tree planting campaign, community kudos, atlassian giving, environmental impact, sustainability, likes for good, atlassian social responsibility, community challenge

Make every click count—help us plant 50,000 trees! 🌳

Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!

Help us plant more trees
AUG Leaders

Atlassian Community Events