# How can we obtain the value of an attribiute of an insight object in Jira DC?

**URL:** <https://community.exalate.com/t/how-can-we-obtain-the-value-of-an-attribiute-of-an-insight-object-in-jira-dc/6160>\
**Category:** General Questions\
**Created:** [January 29, 2025, 3:47pm UTC](https://community.exalate.com/t/how-can-we-obtain-the-value-of-an-attribiute-of-an-insight-object-in-jira-dc/6160 "2025-01-29T15:47:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabern](https://avatars.discourse-cdn.com/v4/letter/g/cc9497/32.png) [@gabern](https://community.exalate.com/u/gabern)\
**Post date:** [January 29, 2025, 3:47pm UTC](https://community.exalate.com/t/how-can-we-obtain-the-value-of-an-attribiute-of-an-insight-object-in-jira-dc/6160/1 "2025-01-29T15:47:29Z")

</div>

How can we obtain the value of an attribiute of an insight object? I need to read an atribute and if it is a certain value, to continue with the sync

---

<div class="post-metadata">

**Author:** ![Javier](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/javier/32/338_2.png) [@Javier](https://community.exalate.com/u/Javier)\
**Post date:** [April 7, 2025, 8:57pm UTC](https://community.exalate.com/t/how-can-we-obtain-the-value-of-an-attribiute-of-an-insight-object-in-jira-dc/6160/3 "2025-04-07T20:57:38Z")

</div>

Hi @gabern,

To accomplish this, you have to set up a custom field of type “Insight Object/s” and add it to your issue view as seen below:

 ![Javier Pozuelo JPJS-5](https://europe1.discourse-cdn.com/flex018/uploads/exalate1/original/1X/fe6263d8b4d7e9bd6ec91a3d0eed1d5c7a873b4d.jpeg)

The attributes you read in your script will be based on the Insight object you have selected in your issue’s custom field.

This script below retrieves the value of a custom field called `InsightField` from an Insight object. It then extracts the `Name` attribute from this field, removes any square brackets (`[]`), and compares the resulting string with `"JPTest"`. If the value doesn’t match `"JPTest"`, the script stops further execution (via `return`).

```auto
def insightObject = issue.customFields."InsightField"?.value

// Check and read the specific attribute value
def attributeValue = insightObject.Name.toString().replaceAll('[\\[\\]]', '') // Replace 'Name' with your attribute

// Continue with sync if the attribute value matches a certain condition 
if (attributeValue.toString() != "JPTest") {
    return
}

```

You can use debug.error(attributeValue) to check the attribute’s value, for example:

insightObject.Created:

 ![New Note](https://europe1.discourse-cdn.com/flex018/uploads/exalate1/original/1X/07705c10d3cfb44642400c7325a2fb9043203454.jpeg)  
insightObject.Name:  
 ![Sync rules error](https://europe1.discourse-cdn.com/flex018/uploads/exalate1/original/1X/4010ffbc8dbd5a1513e55a2c4c80fb9a60ae1d37.jpeg)

---

<div class="post-metadata">

**Author:** ![Javier](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/javier/32/338_2.png) [@Javier](https://community.exalate.com/u/Javier)\
**Post date:** [April 15, 2025, 3:01am UTC](https://community.exalate.com/t/how-can-we-obtain-the-value-of-an-attribiute-of-an-insight-object-in-jira-dc/6160/4 "2025-04-15T03:01:39Z")

</div>

Hi @gabern,

Were you able to give this a try? Let me know if it worked for you 🙂
