This is in reference to the JSON below. I am using automation to parse the description to automagically create labels. I need to replace any spaces and swap them with underscores during the label creation, as spaces obviously are not allowed in labels.
Some of the labels I want to create that come right after the ":: " in the description contain spaces, and I need to replace them with underscores in the add label portion in order for this automation to work.
Does anybody know how I should write the JSON for this to work for me?
Any help would be greatly appreciated.
Thanks!
{
"update": {
"labels": [{
"add": "{{issue.description.subStringBetween("AssetCare Application :: ",";")}}"
},
{
"add": "{{issue.description.subStringBetween("AssetCare Solution :: ",";")}}"
},
{
"add": "{{issue.description.subStringBetween("Portfolio : ",";")}}"
},
{
"add": "{{issue.description.subStringBetween("Host :: ",";")}}"
},
{
"add": "{{issue.description.subStringBetween("Asset Identifier :: ",";")}}"
},
{
"add": "{{issue.description.subStringBetween("Asset Type :: ",";")}}"
},
{
"add": "{{issue.description.subStringBetween("Alert Condition :: ",";")}}"
},
{
"add": "{{issue.description.subStringBetween("Alert State :: ",";")}}"
}
]
}
}
Hi @Chad Cox
Use the following on every add you've got:
{{issue.description.subStringBetween("AssetCare Application :: ",";").replace(" ", "_")}}
This will replace every space with an underscore.
Let me know if that helps :)
Hi Alex,
I appreciated the swift reply. I tried that and it didn't like it, unfortunately... not sure why. I moved on to doing some more detailed if/else combos using variable creation to work out some other tweaks as well, and this appears to be working.
Thanks, and take care :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But what are you exactly trying to accomplish? If e.g. you have the text
AssetCare Application :: Frodo Gandalf Sam; Another Word
You want the words Frodo, Gandalf and Sam all in one connected with an underscore, or to be different labels?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
An example would be:
AssetCare Application :: Connected Buildings ;
I want the label to be Connected_buildings. I tried what you recommended as one of my initial tests this morning, but it didn't seem to like it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.