Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to update Insight custom fields based on the value change for a Insight custom field?

Gaurav Gupta June 10, 2021

Hello,

We need to read/ update the Insight custom fields (like name) based on the selection of unique identifier, namely id field. All these fields are attributes of the Insight object.

While creating automation in JSM cloud, the "Edit Issue" action throws the below error.

An error occurred while requesting remote information

Bad Request

No fields or field values to edit for issues (could be due to some field values not existing in a given project):

Any suggestion on how this can be achieved?

Thanks

Gaurav

3 answers

1 vote
Razvan Nechifor February 1, 2022

You can try to use Lookup object action and after that Edit issue action and use smart values to populate the Insight custom field.

e.g.

User selects in customfield_xxxxx the value for Employee Id.

Automation configuration:

  • Trigger: Issue created or Field value changed (Employee Id) - the 2nd option will cover all possible events and can help you test the automation
  • Action Lookup objects:
    • select Schema in which the Employee Id and Name are stored.
    • use the syntax: Key = {{customfield_xxxxx}}
  • Optional Action: Log action
    • Employee Name = "{{lookupObjects.Employee.Name}}"

this action can help you identify the values that will be placed in the Insight customfield and troubleshoot erros (in case the values are not the ones you are expecting).

  • Action Edit issue fields:
    • choose Employee name custom field.
    • operation Set query: syntax: Name = "{{lookupObjects.Employee.Name}}" (Employee is name is of the object where all attributes described above are stored, Name = attribute of the Employee).

I hope this will help you.

Semih Tolga Yazıcı November 8, 2023

Hi Razvan,

Your solution completely works. I just understand how to avoid Bad request error and want to add a few things in your solution.

If an object is already specified in a customfield, and it is wanted to add attributes of it in other customfields. We don't need to use lookupObjects for that case which will work but take more resource cost.

It works to only use the smartvalue below while editing asset object in Automation.
Name = "{{issue.fields.customfield_xxxx.Attribute Name.Name}}"

For an information: It is an object that's why unfortunately only providing the smart value below not working and causes Bad request error. 

{{issue.fields.customfield_xxxx.Attribute Name.Name}}

0 votes
Chad Jackson January 20, 2023

@Gaurav Gupta  wondering if you were able to get this working. I am running into the same issue trying to use automation to populate a custom field with 

an attribute value based on the selection in another field similar to what you have described.

 

Thank you, Chad

0 votes
Alex van Vucht (GLiNTECH)
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.
June 10, 2021

There are two types of rules:

  1. Insight object rules. These use the "When object changed" triggers.
  2. Issue rules. All other triggers.

The "Edit issue" action cannot modify Insight object attributes. Use the "Edit object" action for the first type of rule. Use the "Edit Insight field attributes" for the second type of rule.

Gaurav Gupta June 11, 2021

Hello,

I do not want to update the Insight Object or attribute. The use case is:

1. User selects the Employee Id (Insight custom field on the create issue screen)

2. Issue is created with the Employee Id

3. The view issue screen has the Employee name field (Insight custom field) --> We need this field to auto-populate from the Insight schema based on the Id selected.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events