Jira Smart Value - get rid of asset key

Maggie Rivard November 22, 2022

I am using the assets section of JSM and a custom field (assets object) named Hardware Affected and Software Affected to reference those assets in our issues.

I am using the automation tool in JSM to edit the summary field for all issue types:

{
"fields": {
"summary": "{{issue.location}} - {{issue.Request Type.requestType.name}} : {{issue.Software Impacted}}, {{issue.Hardware Impacted}}"
}
}
}

This is the output:

Hill - Request New Feature : Angel (MHL-67), ACAS (MHL-86), NAS (MHL-45)

I want to get rid of the asset key (MHL-XX)

I am wondering what I need to change to get the output to this:

Hill - Request New Feature : Angel, ACAS, NAS

 

image.png

image.png

2 answers

0 votes
Durell Demartini
Contributor
October 17, 2024

Using {{issue.customfield_xxxx.summary}} works to remove the Asset key, as found in this post:

https://community.atlassian.com/t5/Jira-Service-Management/Automation-to-Copy-Asset-Fields-data-to-Summary/qaq-p/2438540

0 votes
Robert Wen_Cprime_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 22, 2022

Hi Maggie,

I'm going to hazard a guess here because I need to see how the objects that you have for Software Impacted and Hardware Impacted fields are set up, but I think you man need to just append the .name or the attribute that references the name?

So your line would look like

"summary": "{(issue location]} - {{issue.Request Type.requestType .name}] : {issue.Software
Impacted.name}}, {issue.Hardware Impacted.name))"
Maggie Rivard November 23, 2022

Thank you for getting back to me so quickly @Robert Wen_Cprime_ 

I attempted to put .name at the end of those two with no success. I attached some more info, hopefully this helps.

 

image.pngimage.pngimage.png

Robert Wen_Cprime_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 23, 2022

Hi @Maggie Rivard 

See if capitalizing the N in Name works.  That should conform to the way it's specified in this instruction: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-insight/

Maggie Rivard November 28, 2022

 

@Robert Wen_Cprime_  no joy

Sam Huawey
Contributor
October 5, 2023

Same here - with .Name nothing is shown, without name it shows <Name> (<key>). Looks like a bug in documentation.

Like Rubèn C_ likes this
Redaktion User
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 26, 2024

I have a similar problem to this. Have you found a solution in the meantime and/or has the bug already been reported in the atlassian bug tracker?

Sam Huawey
Contributor
August 28, 2024

@Redaktion User Looks like there is no other way than using text functions, e.g. regexp replace


Hello World!
{{issue.summary.replaceAll("(lo)","xx$1yy")}} -> Helxxloyy World!


Like Redaktion User likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events