Forums

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

How do I combine 2 string smart values in jira automation advanced edit field section?

Amed Moreno February 2, 2023

Hi, 

I'm trying to mimic how Jira Data Center shows "Completed Sprints" (which is not actually a field) but shows in the Jira UI like below:

2023-02-02 18_41_48-[TSP-23] As a user, I'd like a historical story to show in reports - DraftKings .png

I figured out how to get that to look the same (with exception of link to sprint, would be nice to get that part as well).  However, when there is multiple sprints the UI shows it in this format:

2023-02-02 18_43_26-[PLATDB-5608] [AWS] Training and courses - DraftKings Jira DC.png

But the automation I write prints it like this:

2023-02-02 18_44_26-[PLATDB-5608] [AWS] Training and courses - DraftKings Jira DC.png

My JSON in Automation is configured like this at the moment:

{
"fields": {
"customfield_36808": "{{issue.fields.customfield_10100.name}} - ended {{issue.fields.customfield_10100.completeDate.format("dd/MMM/yyyy")}}"
}
}

Any help in how I can get this to populate the way the Jira UI populates it would be greatly appreciated

1 answer

1 accepted

2 votes
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.
February 2, 2023

Hi @Amed Moreno 

Are you trying to get a list of completed sprints for a single issue, a collection of issues, something else?

To get what you described for a single issue, that has been in multiple sprints, please try this using an iterator over the sprint list field:

{{#issue.sprint}}{{name}} ended {{endDate.format("dd/MMM/yyyy")}}{{^last}}, {{/}}{{/}}

I used a comma delimiter, which you could replace as you need.

Kind regards,
Bill

Amed Moreno February 2, 2023

Hi @Bill Sheboy ,

Thanks so much!  That worked.  I'm trying to get a list of completed sprints for a single issue, I just couldn't understand how to get the format to come out the right way. 

Do you know of a way to get it to print, instead of comma separated, in a list form (separate lines that is)?  Would that be possible?

Amed Moreno February 2, 2023

@Bill Sheboy 

Actually, I figured out the answer to my previous question.  By using \\\\ as delimiter and if I change the multi-line text field from default renderer to wiki, it prints in separate lines.  

Thanks again for the help on this!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer