Hey guys
Having Insight configured, with plenty of objects.
HWC-1 to HWC-300
In Jira automation, trying to make an automation to set an Insight object "Factory" on custom field 10772 when user has selected proper factory name
You can not choose Insight custom field field (I mean i could for a while but then it disappeared) so using "More options".
Using that code
{
"fields": {
"customfield_10772": [{ "set" : [{"key":"HWC-30"}] }]
}
}
I can see that something happens (because the field gets blanked if something was in it) but definitively whatever what I tried, it just does not work.
What to do ?
And if I arrive to it, how to use {{lookupObjects}} (which already displays HWC-30 in logs) ?
thanks
Re-posting as an answer rather than a comment.
I eventually got this to work, but the documentation was not helpful.
Get your insight workspace ID via the REST endpoint via a logged in browser:
https://<workspace>.atlassian.net/rest/servicedeskapi/insight/workspace
In your IQL triggered automation step - which has access to the resulting {{Object}}s, via additional JSON, use:
{
"fields": {
"customfield_10135": [{
"id":"abcd-abcd-1234-abcd:{{Object.id}}"
}]
}
}
Where customfield_10135 is the custom field ID of your *Insight objects* custom field (NOT assets), and abcd-whatever is the workspace ID from your REST result.
In the example above, you'd use:
"customfield_10772": [
{
"id": "82b9f04d-8bdc-47c7-9211-8787900659fa:24"
}
]
Hope this helps!
If you want to set an object in an insight custom field you actually have to use the full field information of an object.
In the jql search lin advanced mode and lookup your field with the object you want to use. It will be a long string that includes the hwc key + the actual name of the object.
Try copying that full string and pasting it to your automation rule.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thansk for answer.
However I am not sure I get it. So far my understanding is that information is not duplicated in the issue, but it is a pointer that points to an Insight object.
When I do a "get issue" I get only pointer info.
"customfield_10772": [
{
"workspaceId": "82b9f04d-8bdc-47c7-9211-8787900659fa",
"id": "82b9f04d-8bdc-47c7-9211-8787900659fa:24",
"objectId": "24"
}
]
What I need to have is something dynamically, so no need to copy anything anywhere.
1 - In the triggered automation rule (field edited), get the Insight object (OK)
objectType = "Factory" AND "Factory label"={{fieldChange.toString}}
this gives me a nice
{{lookupObjects}}
In logs, I see content (maybe mapped) is "HWC-30" or other, works ok dynamically
2 - Edit the Insight custom field, in the issue that triggered automation
I do not want to do anything in Insight itself.
The "official way" of setting a field does not work with {{lookupObjects}} so I am trying first manually with a key.
I tried also to blank the field, and push workspaceId, id, and objectId, but still no luck.
Annoying... maybe there is something else.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah I see.
I would use the built in insight postfinctions then. There is one about writing a value based on a insight customfield selection. However, they only work when you are performing a transition.
So if you want to edit it, you need to create a transition that calls itself with a transition screen that provides the insight custom field that makes the initial selection.
I hope this helps.
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 eventually got this to work, but the documentation was not helpful.
Get your insight workspace ID via the REST endpoint via a logged in browser:
https://<workspace>.atlassian.net/rest/servicedeskapi/insight/workspace
In your IQL triggered automation step - which has access to the resulting {{Object}}s, via additional JSON, use:
{
"fields": {
"customfield_10135": [{
"id":"abcd-abcd-1234-abcd:{{Object.id}}"
}]
}
}
Where customfield_10135 is the custom field ID of your *Insight objects* custom field (NOT assets), and abcd-whatever is the workspace ID from your REST result.
In the example above, you'd use:
"customfield_10772": [
{
"id": "82b9f04d-8bdc-47c7-9211-8787900659fa:24"
}
]
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nick Thomsonyou sir are a hero.
For those looking for complete solution:
First you have to use action "Object lookup" where you can use smart values. In my case I used:
objectType = Organization AND "Name" = "{{issue.Name of the organization}}"
This saves result in another smart value {{lookupObjects}}
You then have to find insight id of your instance as stated above.
Then you can use "Edit issue", turn on advanced mode and have something like this:
{
"fields": {
"customfield_10060": [{
"id":"abcd-123456-efgh-asd65dca:{{lookupObjects.id}}"
}]
}
}
Beware that I haven't tried this for multi object field - it might need a bit different.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I second that!
@Dominique Wille can you please accept the answer of @Nick Thomson
It will help a lot of people who are facing the same issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Rudy Holtkamp @František Špaček _MoroSystems_ . As I originally posted a comment reply, I have reposted as an answer below.
Glad I could be of help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wanted to add this on for anyone searching for this issue...
This is for insight objects that utilize a key
Setting the key sets the insight object as the one you want to put in.
Example:
{
"fields": {
"customfield_id": [
{
"key": "Put key here"
}
]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep here's an example of mine where I set two insight fields including a second one that normally only shows its options based on the input to custom field 17700 and also setting a customer request type at the same time
{
"fields": {
"customfield_17700": [{
"key": "SQ-349938"
}],
"customfield_17701": [{
"key": "SQ-350003"
}],
"customfield_13704": "Infrastructure Request"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here's another addition to your solutions:
If you work with an LookupAssets you can use this json to add the assets from the lookup to an asset custom field:
{
"fields" : {
"customfield_XXXXX" :
{{lookupAssets.objectKey.asJsonObject("key").asJsonArray}}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Leonie C_ Breitmoser it's worked! Thank you !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Team,
This is work for me, thanks
{
"fields": {
"customfield_10520": [{
"id": "956a4a68-32e1-4216-bab3-edcf04027c1e:2248"
}]
}
}
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.