Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Populate context field with Insight object based on customer form Insight field value

Andrew Williamson March 28, 2022

I have two Insight object types:

  1. A User object type
  2. A Device object type
    1. Contains a 'Serial Number' attribute

 

The Device object type references the User object type - i.e. a Device object references a User object through an Owner attribute.

 

When a Customer submits a Device support request form, they select their user from an Insight Object custom field dropdown list.

Is it possible in implement some automation that checks the selected Users object for a Device object reference, pulls the referenced devices Serial Number attribute, and updates a Context field with that devices S/N?

Alternative would be to have the S/N custom field as a customer-filled-out field in the request form, but I don't expect most of my users to know where to even find their device S/N.

 

1 answer

1 accepted

1 vote
Answer accepted
Mark Segall
Community Champion
March 28, 2022

Hi @Andrew Williamson 

Yes this is totally possible and you can actually eliminate the need for the user selector (unless you want them to be able to select someone else).  If this is the route you'd like to take, set the Filter issue scope (IQL) like this:

Owner = ${Reporter}

Otherwise, if you still want the reporter to be able to select any user, you would do something like this for your Filter Issue Scope:

Owner = {customfield_xxxxx}

where xxxxx = the field ID of your first Insight field

Andrew Williamson March 28, 2022

@Mark Segall Thanks for the speedy reply, hugely appreciated!

 

I'm trying to get this up and running, but I think i'm configuring it incorrectly. I've tried both of:

  • Serial Number as a Context field
    • Is not being automatically populated
  • Serial Number as a Customer field
    • Is returning no objects when a User is selected and that user owns a Device object in Insights

 

 

I have two Insights object types:

  1. User Object Type
  2. MacBook object type
    1. Has Attribute 'Serial Number'
    2. Has Attribute 'Owner' (of type Object, points at the above User object type)

I have two Custom fields of type Insight Object:

  1. User
    1. filter scope: objecttype = users
  2. MacBook Serial Number
    1. filter scope: objecttype = macbooks

 

My User custom field (ID 10558) has following config:
UserConfig.png

 

My MacBook Serial Number Custom Field has the following config:

MacbookConfig.png

Mark Segall
Community Champion
March 28, 2022

Can you provide a little more context into how the users object type is set up?  Specifically, the user attribute - Is it set to type "User" or is it simply a text field?

Andrew Williamson March 28, 2022

Are you referring to the Insight User Object-type attribute setup? If so, screenshot below!

InsightUserConfig.png

 

And the MacBook insight object config - note the Owner attribute, of type Object pointing at the Users Object type:

MacbookInsightConfig.png

Mark Segall
Community Champion
March 28, 2022

So based upon this, it looks like you need to do something like this:

OPTION 1 - Looking up against the current user

object HAVING outboundReferences("Jira User Account" = ${reporter})

OPTION 2 - Looking up against what was selected in the user field

object HAVING outboundReferences("Jira User Account" = ${customfield_10558.Owner})

 

Andrew Williamson March 28, 2022

the Jira User Account attribute isn't important here though, is it? 

The Insights Object custom field is pointing at the Users object type. Jira User Account is just an attribute of that Object Type.

And the MacBooks object type Attribute 'Owner' points at the Users object type, not Jira User Account attribute 

Mark Segall
Community Champion
March 28, 2022

Let's take a step back.  Which option of the two are you trying to make work?  If option 2, I just realized my last post had the wrong query (let myself overthink it) and should be this:  

Owner = ${customfield_10558}

I was missing the "$" on my first post.

Andrew Williamson March 29, 2022

Excellent, that works now! 

 

Thanks Mark - appreciate the support! :) 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events