Insight custom field not getting populated from single select field using automation rule

harilal.poyil January 14, 2022

I'm trying to populate insight custom field from select list(single choice) custom field using automation rule(using smart values)

{
"fields": {
"customfield_12405": [{"summary" : "{{issue.customfield_13602.value}}"}]
}
}

 This rule run successfully. But not populating insight custom field with name equal to that of selected single select custom field value.

I tried to print {{issue.customfield_13602.value}} to the audit log and it's showing the value correctly and there is insight object with exact name.

It would be a great help if you could help with this issue.

 

2 answers

0 votes
Björn Gullander
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 27, 2022

Hi,

You would need to get the object key of the object you want to store in the field. In automation for cloud you could use the lookup objects action to find the correct object, but I don't think they are available yet in DC. 

What you could do is to add a post function in the workflow to set the field. Use the Insight post function called Assign Objects from an IQL query based on data from an issue

IQL: Name=${customfield_22222.label}

The same thing can be done in the custom field configuration for the Insight field. There you can set the Filter Assign scope IQL with the same IQL as above. If you also check the "Strict" checkbox you can make the Insight field update automatically when the select field updates at any time. 

Hope that helps!

Björn 

0 votes
Marco Brundel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 14, 2022

Hi  @harilal.poyil ,

What is de name of the attribute that is the label of Insight Object.

Maybe you can try to change 'summary' into the name of this attribute.

regards, Marco 

harilal.poyil January 14, 2022

Hi, tried without giving summary:

{
"fields": {
"customfield_12405": ["{{issue.customfield_13602.value}}"]
}
}

Getting an error: 

PROJECT_KEY-1 (expected Object (customfield_12405))
harilal.poyil January 14, 2022

The label attribute is "Name".

Tried like:

{
"fields": {
"customfield_12405": [{"Name" : "{{issue.customfield_13602.value}}"}]
}
}

 The rule is running successfully. But insight custom field is not getting populated.

Marco Brundel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 14, 2022

Hi,

To investigate further, you can include 

{
"fields": {
"customfield_12405": [{"summary" : "name of a object"}]
}
}

(a real/hard name)

in the rule and try out the rule and then 

{
"fields": {
"customfield_12405": [{"summary" : "Id of a object"}]
}
}


once.

That way you can see what value the system expects.
I hope this helps you figure out what's going wrong.

Regards, Marco

harilal.poyil January 14, 2022

Hi, Tried both ways. But,  insight custom field not getting updated.

Suggest an answer

Log in or Sign up to answer