Forums

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

Possible to populate custom fields using insight attributes via selecting an insight object

Ronnie Wan August 26, 2022

Is it possible to populate custom fields using insight attributes via selecting an insight object.

I know you can do it with user fields as shown here:
https://confluence.atlassian.com/jirakb/auto-populate-approvers-from-insight-objects-1072474097.html

{
"fields": {
"Approvers": {{System object.Owners.flatten.asJsonObjectArray("id")}}
}
}

But what if i was to do this with text fields, select list fields, is that possible?

Currently using Automation for Jira for this -> Edit issue.

Thanks

1 answer

1 accepted

1 vote
Answer accepted
Hana Kučerová
Community Champion
August 26, 2022

Hi @Ronnie Wan ,

I believe it should be possible, but be aware, that each type of custom field expects different formatted data - if the provided data is incorrect, custom field value won't be stored.

Ronnie Wan August 27, 2022

Thanks @Hana Kučerová 

Are you able to provide examples as I can't find any documentation which helps

Hana Kučerová
Community Champion
August 29, 2022

@Ronnie Wan Please, what exactly is your use case, which attributes do you need to store?

Ronnie Wan August 30, 2022

Hey @Hana Kučerová 

So I have an insight object called Template.

This object in Insight has attribute fields such as select list, text fields, date fields

I also have an Insight custom field called Template which is based off the Insight object mentioned above.

And what i am wanting to do is when a user selects a template via the custom field, in automation for Jira I can put something there which populates custom fields on a jira ticket such as; a select list, text fields, date fields using attributes from that template object stored in Insight.


Hana Kučerová
Community Champion
September 5, 2022

@Ronnie Wan

I'm sorry for the late answer, it took me a little bit time to test it.

So, I've got:

Custom fields:

  • "Test Short text" with type Text Field (single line) 
  • "Test Select List" with type Select List (single choice) - values Red, Green, Blue, Black
  • "Test Date Picker" with type Date Picker
  • "Test Template" with type Insight objects, which shows objects from Insight scheme with object type Template

Object type Template has attributes:

  • "Test attribute Short text" with type Default - Text
  • "Test attribute Select List" with type Default - Select - values Red, Green, Blue, Black
  • "Test attribute Date Picker" with type Default - Date

 

Now, my automation rule looks like this:

WHEN: Value changes for Test Template

IF: Test Template is not empty

THEN: Edit issue fields:

  • Test Short text: {{triggerIssue.Test Template.Test attribute Short text}}
  • Test Date Picker: {{triggerIssue.Test Template.Test attribute Date Picker.format("yyyy-MM-dd")}}
  • Test Select List: {{triggerIssue.Test Template.Test attribute Select List}}

 

Probably you will need to experiment with this a little bit, but in general it works for me.

Ronnie Wan September 6, 2022

Thanks @Hana Kučerová 

I've managed to get most of it working,

I forgot to mention, is there a way to copy across text attribute fields into insight custom fields?

Or a way to copy across object attribute values from insight into object custom fields?

Thanks!

Hana Kučerová
Community Champion
September 6, 2022

@Ronnie Wan I’m sorry, I don’t understand what you mean. Can you give me an example, please? Thank you.

Ronnie Wan September 6, 2022

@Hana Kučerová 

So similar to what you said before, for e.g.

I'm wanting to use the same Template logic in that an insight object custom field called Squad gets the data from the template insight object using the attribute also called Squad. - This is not a short text attribute, but an object attribute in Insight.

Hope that makes more sense?

Hana Kučerová
Community Champion
September 6, 2022

@Ronnie Wan If I get it right, it should be possible to use:

{{triggerIssue.Test Template.[Squad attribute name in template object].[Squad attribute name]}}

So, in your case probably:

{{triggerIssue.Test Template.Squad.Name}}

Like Ronnie Wan likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events