Smart value to update a line in custom field.

Zubair Khan December 15, 2021

When I'm trying to use this {{issue.description.match("(Customer Account\:.{0,15})")}} smart value in Jira automation. 

The field result is like this Customer Account: "Customer Account:  XYZ  " 

Is it possible to update only the name XYZ in the Customer Account field?  

2 answers

1 accepted

0 votes
Answer accepted
Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 15, 2021

Hi @Zubair Khan

I haven't tried this myself, but you could try to do use a smart value with the replace function like this:

{{issue.description.replace({{issue.description.match("(Customer Account\:.{0,15})")}}, "Customer Account: NEWVALUE")}}

Does that work for you?

Alternatively, you could also store the value of Customer Account into a custom field. That's the way I'd prefer (without knowing your exact use case) in order to use it for filtering in other views.

Cheers,
Matthias.

Zubair Khan December 16, 2021

Hi @Matthias Gaiser _K15t_ 

Thanks for the response.

My use case is, I need to copy a line from description field to a custom field "customer account"

When I use this  smart value it's not working.  

{{issue.description.replace({{issue.description.match("(Customer Account\:.{0,15})")}}

 Capture.PNG

 

Thanks

Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2021

I see. Then I made it more complex than it was intended. You could simply use this statement then:

{{issue.description.match("Customer Account\:(.{0,15})")}}

Note that I have moved the rounded brackets to the actual part which you want to extract.

Cheers,
Matthias.

Like Zubair Khan likes this
Zubair Khan December 20, 2021

@Matthias Gaiser _K15t_ 

 

Thanks a lot. It's working 

Like Matthias Gaiser _K15t_ likes this
0 votes
Barry Ozer March 22, 2022

@Matthias Gaiser _K15t_ Is it possible to use the same match smart value to create user stories with the match being each user story summary? Here is screenshots to show what I am trying to accomplish and the error message I get. My goal is to be able to automate user story creation based on each Action Item recorded as a line item in an Epic's Description at the time of the Epic creation. Thanks for the assist in advance.

Screen Shot 2022-03-22 at 1.12.05 AM.pngScreen Shot 2022-03-22 at 1.11.53 AM.pngScreen Shot 2022-03-22 at 1.11.48 AM.pngScreen Shot 2022-03-22 at 1.10.48 AM.pngScreen Shot 2022-03-22 at 1.09.38 AM.png

Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 22, 2022

@Barry Ozer - that should work.

I think you might have a problem with your regex and the colons, you could try this regex instead:

AI1: (.{5,35})

I often use a webpage like regex101.com in order to check the regular expressions I write.

 

PS: I'd generally recommend creating a new question - that way also other people will more likely jump in and help you. You could still tag me over there :)

Like # people like this
Barry Ozer March 22, 2022

Thank you. I'll be sure to pose a question instead of an answer next time. That worked like a charm @Matthias Gaiser _K15t_ .

Like Matthias Gaiser _K15t_ likes this

Suggest an answer

Log in or Sign up to answer