Forums

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

Smart value to refer to custom field and concatenate

Jithesh February 10, 2022

I am trying to create Unique ID as the default key generated by Jira is not sufficient for my project.

If my Unique ID is based on two fields:

1) issue.key (the one generated by Jira)

2) Request Type (custom field created by me which has 6 to 7 dropdown values each value is a combination of TEXT and a Code). for example "Deployment Focus Training-DFT" here "Deployment Focus Training" is the text and "DFT" is the code.

 

so is Issue.key is MEA-15 and Request Type is "Deployment Focus Training-DFT"

My Unique ID should be "DFT-15"

for this I have written the following code in the Automation, but its now working:

{{issue.Request Type.split("-").last.concat(issue.key.split("-").last)}}

Kindly guide what am I doing wrong.

I have tried the below code as well, this also didn't work.

{{issue."Request Type".split("-").last.concat(issue.key.split("-").last)}}

1 answer

1 accepted

0 votes
Answer accepted
Alexis Robert
Community Champion
February 10, 2022

Hi @Jithesh ,

 

have you tried without the concat function ? If you juste add both values like this it should work : 

{{issue.Request Type.requestType.name.split("-").last}}-{{issue.key.split("-").last}}

 

Let me know if this helps, 

 

--Alexis

Jithesh February 10, 2022

The first part is not working: {{issue.Request Type.requestType.name.split("-").last}}

I also tried: {{issue.Request Type.name.split("-").last}}

Request Type is a single choice Custom field I have created. Just FYI

Jithesh February 10, 2022

@Alexis Robert 

I just saw that there is a system field with same name "Request Type"

so tried with changing the name of custom field and used the below code and it seems to be working.

{{issue.Training Request Type.value.split("-").last}}-{{issue.key.split("-").last}}

Thanks for guiding me to figure out this solution...

Alexis Robert
Community Champion
February 11, 2022

Ah great, I was wondering if you had actually created a new field with the same name or not.

Glad to know it's fixed, don't hesitate to mark this answer as accepted so that other users can find it later.

 

Have a nice day ! 

 

--Alexis

Like Jithesh likes this

Suggest an answer

Log in or Sign up to answer