Forums

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

extract a sub string from last comment body by using smart values

Gilad Shtern
Contributor
August 6, 2023

Hi,

 

I'd like to extract a sub string from last comment body by using smart values.

{{issue.comments.body.split("owner: ").last}}

For example:

----

Hi,

Pls, make sure to ... as owner: A1234.

------

In this example A1234 as Owner by using 

Kindly,

Gilad

 

 

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
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.
August 6, 2023

Hi @Gilad Shtern 

The comments field is a list.  Do you want this information from the last comment, or something else?

If the last one, please try this:

{{issue.comments.last.body.split("owner: ").last}}

Kind regards,
Bill

Gilad Shtern
Contributor
August 7, 2023

Hi Bill,

I was able to change owner custom fields, but not reporter.

I saw in the community that we need to fetch customer.accountid.

My open issues:

1.Is this relevant for data center as well?

2.How do I now the actual account?

 

Kindly,

Gilad

Bill Sheboy
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.
August 7, 2023

I believe the smart value expression I provided should work with Server / Data Center, as it uses not specific Cloud features.

If you only have the user name and need the account id to set a field, there are not many options for Server / Data Center yet.  I believe you would need to call the REST API with a web request to get the value.  (Please note: the Lookup Issues action is being added for Server / Data Center automation...and once that is added it will be easier to use JQL to find the account id from an existing issue.)

Suggest an answer

Log in or Sign up to answer