Hi!
We are trying to setup a simple clone of tickets, in the ticket we have a vendor app custom field called "location" (customfield_10105)
When trying to clone this field i get
(The value must be a JSON object. (customfield_10105))
For testing i created a test automation that manually triggers, stores the location in "VarLocation" outputs the "VarLocation" to the logs and then edits the field with advance Json editor:
{
"fields": {
"customfield_10105": "{{varLocation}}"
}
}
Logs:
Rest API:
Vendor app (Maps, Locations and Territories for Jira):
Maps, Locations and Territories customer documentation - Confluence (atlassian.net)
Any ideas out there? :)
Hi, the author of the app here.
When cloning the Issue through Automation, please make sure to copy the JSON field by field, e.g.:
{ "fields":{ "Location":{
"lat": {{triggerIssue.Location.lat}},
"lng": {{triggerIssue.Location.lng}},
"morton": {{triggerIssue.Location.morton}},
"address": "{{triggerIssue.Location.address}}",
"addressAux": "{{triggerIssue.Location.addressAux}}",
"mode": "{{triggerIssue.Location.mode}}" }
} }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I am the author of the plugin. Please use the following Custom JSON:
{
"fields":{
"customfield_10044":{
"lat": {{triggerIssue.customfield_10044.lat}},
"lng": {{triggerIssue.customfield_10044.lng}},
"morton": {{triggerIssue.customfield_10044.morton}},
"address": "{{triggerIssue.customfield_10044.address}}",
"addressAux": "{{triggerIssue.customfield_10044.addressAux}}",
"mode": "{{triggerIssue.customfield_10035.mode}}"
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Thomas Talving -- Welcome to the Atlassian Community!
Given that field has different attributes, and is from a marketplace addon, I suspect you will need to set each attribute in the JSON from the source location: lat, lng, etc.
Checking the vendor's documentation will help to confirm what is needed.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately their documentation isn't really that helpful.. :/
Maps, Locations and Territories customer documentation - Confluence (atlassian.net)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In that case, I recommend contacting their support team from the marketplace:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Thomas Talving have you tried creating a manually triggered automation to create a clone of the current issue? Then under fields to set chose "location" (customfield_10105) copy from current issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The location field isn't showing up as a field. so need to use the advance editor to access it. Because its an app, they have a custom type called - Object - Location
Otherwise this would 100% be the way to go. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The only other thing I can suggest is that since the value must be a JSON object you use either replace or replaceAll to change the '=' in varLocation to a ','
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#replace-String-target--String-replacement-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
and you'll also have to put quotes around the address
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created a new variable with the smart value
{{varLocation.replace("address=","address=\"").replace(", addressAux","\", addressAux").replace("=",", ")}}
Since I can't test against the app, I just used log actions
This has taken out the equals signs and replaced them with commas which is more like JSON, and putting equals around the address text 'should' work but I can't test that.
You may also have to add in additional replaces to remove the { and } at the start and end but I don't know:
.replace("{","").replace("}","")
I don't know if all of this will work, but it's all I can think of to get round the requirement for it to be a JSON object
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think I made a mistake and it should be replacing = with : and surrounding the key names with quotes, try this:
{{varLocation.replace("lat","\"lat").replace("lng","\"lng").replace("morton","\"morton").replace("mode","\"mode").replace("address=","\"address=\"").replace(", addressAux","\", \"addressAux").replace("=","\":")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same issue, Got contact with the vendor now but they didn't have a solution. They are apparently looking into how to do this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One last thing I can suggest is to replace auto with "auto":
{{varLocation.replace("lat","\"lat").replace("lng","\"lng").replace("morton","\"morton").replace("mode","\"mode").replace("auto","\"auto\"").replace("address=","\"address=\"").replace(", addressAux","\", \"addressAux").replace("=","\":")}}
And possibly remove addressAux as it is empty in your example:
{{varLocation.replace("lat","\"lat").replace("lng","\"lng").replace("morton","\"morton").replace("mode","\"mode").replace("auto","\"auto\"").replace("address=","\"address=\"").replace(", addressAux=,","\", ").replace("=","\":")}}
Beyond that I don't think I can help, but good luck with it
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.