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

Automation to fill insight field in issue automatically

Janis Pirgge January 27, 2022

Hi Community,

 

I'm trying to set up an automation, which automatically fills out:

1. insight field in an jira issue based on the selected value of an other insight field.

2. The organization based on an insight field.

 

I have the following use case:

In the jira service management tickets the service team member shall select the affected system in the field system. The field is an insight objects field.

image.png

 

When the value of the field is changed an automation rule should start, which look ups the insight objects of the specific obejcttype "System" an searches for the Attribute "Kennzeichen" = "UML-Test-RTW" (the selected system).

It shall pick the referenced object "Kunde" and paste it in the insight object field "kunde" of the issue.

image.png

 

Unfortunatly i wasn't successful so far. My automation looks like that:

image.pngimage.pngimage.png

 

Thanks for your help!

BR

Janis

2 answers

1 accepted

2 votes
Answer accepted
Janis Pirgge January 31, 2022

Hi,

 

I now was able to get the correct query for the lookup object: image.png

The query delivers the attribute "Kunde" of the object, which was selected in the field "System" ("UML-Test-RTW").

 

After a few tries, i was able to find the correct statement, which pastes the attribute value in the field "Kunde".

image.png

Maybe this will help someone else. ;-)

 

BR
Janis

Jaime Gonzalez February 18, 2022

Hello, I am trying to achieve this during issue create, via webhook trigger. Following your recommendations, I am able to query the object using the name and the Lookup Objects action. However, when attempting to set the value during the issue create acton, the insight field is not set:

ABC ITSM.jpgEquipos o hardware relacionado.jpgDetails.jpg

Any ideas? Thank you

Janis Pirgge February 21, 2022

Hi Jaime,

I had some problems with my first solution so I talked to the atlassian support. 

Here is the rule, which finally worked. Maybe this helps you too. The log actions are really helpful for problem analyzation:

 

image.pngimage.png

{{issue.system.label}} Value: {{#issue.system}}"{{label}}",{{/}}

image.png

 

image.png

{{test.substringBeforeLast(",")}})

 

image.pngobjecttype in objectTypeAndChildren(18) AND ("kennzeichen" IN ({{test.substringBeforeLast(",")}}) OR "Name" IN ({{test.substringBeforeLast(",")}})) 

image.pngimage.png

 

Maybe this will help you somehow.

Jaime Gonzalez February 21, 2022

Hi @Janis Pirgge thank you very much for responding to my question.

Following your suggestions, I realized it was not working for me as I was attempting to set the insight field within the webhook trigger rule, which apparently is not possible, because there is no reference issue at this point.

What I ended up doing, is create a 2nd rule that triggers after the webhook creates the issue, and then set the insight field there, using the value of the Affected Hardware field, that was previously filled by the 1st automation rule, using data from the webhook.

I hope this makes sense for other running into the same issue.

Thanks again for your support, have an excellent day!

Jaime.

Deleted user April 27, 2022

is this also for jira datacenter ?

Janis Pirgge April 27, 2022

@[deleted]  in the latest newsletter they said, that Automation for Jira will be included in Data Center in the next few months. So I would say, as soon as this happens it should also work for data center. 

Like Deleted user likes this
Sergei Gridnevskii
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.
September 2, 2022

Strange,

When I set an Insight field from another field it works fine.

Key="{{customField_14472}}"

When I set it using text I get Internal Server Error.

Name LIKE "{{approle.Role.Name}}"

My head is going to blow up.

Sergei Gridnevskii
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.
September 5, 2022

Finally I found an answer. The post should be like this:

"customfield_14472": [{"workspaceId":"e02eca9b-beba-4406-bcbc-6c95dcb24212","id":"e02eca9b-beba-4406-bcbc-6c95dcb24212:8155","objectId":"8155"}]

How to get workspace ID?

Set the field in the issue manually and then go to 

https://<yourcompany>.atlassian.net/rest/api/latest/issue/<issue_key>

Search for custom field number. You will see the record like above.

How to set object by Key?

Just remove the first letters and dash. My object was AR-8155, so I used 8155.

Like Rodolfo Bortolin likes this
1 vote
Rilwan Ahmed
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 27, 2022

Try automation rule "Issue updated" 

Suggest an answer

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

Atlassian Community Events