Forums

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

Can I copy Asset object type name to custom field (Data Center)

Boyan Angelov (Nemetschek Bulgaria)
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.
March 25, 2025

Hello,

On a Data Center instance I create an issue when an asset object is created (using the Assets automation rules). In the Create transition of the issue I need to set in a text custom field the name of the object type of the connected asset (there is a custom field of type Asset object, which is set with the corresponding object). I tried with the Assets postfunction that  copies object attribute value to custom field, but I cannot make it work and nothing is set in the custom field. Any ideas on how this can be done?

Thanks!

1 answer

1 accepted

2 votes
Answer accepted
Marc - Devoteam
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.
March 25, 2025

HI @Boyan Angelov (Nemetschek Bulgaria) 

You probably need another automaton rule that is triggered after this rule ends.

In cloud you have the option to refresh the data of an issues inside an automation rule, but in DC this is not possible (I think).

The custom field needs to be populated before you can use the value in it and if this is set in an automation rule, then the issue needs a re-index, before this information can be used in automation.

So within Cloud there is an action for this in automation, to do this in the active rule, but in DC I think you can't do this and there for need an additional automation rule

Boyan Angelov (Nemetschek Bulgaria)
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.
March 25, 2025

Hi Marc,

Thanks for the quick response. However I could not understand what automation rule you refer to. The Automation I use to automatically create a ticket when asset is created belongs to the Assets automations, not Jira automations. I do not think I can use either to fetch the name of the object type and copy it in a custom field on DC. Or am I wrong? My hope was that I can use the Assets postfunction in the workflow, but so far I was not able to make it work.

Cheers,

Boyan

Marc - Devoteam
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.
March 25, 2025

Hi @Boyan Angelov (Nemetschek Bulgaria) 

Object type names are not fetch able.

Reading documentation this should be possible on object attributes see https://confluence.atlassian.com/servicemanagementserver/post-functions-1044784443.html# 

Boyan Angelov (Nemetschek Bulgaria)
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.
March 25, 2025

Hi @Marc - Devoteam ,

I cannot seem to find the right "object attribute name" to use to fetch the name of the object type. I tried with "Object Type", "objectType", "objecttype", etc... but nothing seems to work. I am starting to think it is not supported at all...

Marc - Devoteam
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.
March 25, 2025

Hi @Boyan Angelov (Nemetschek Bulgaria) 

Objecttype can only be used for context on a field or in an aql.

The name of the object type can be used.

You could create objects in an object type with a name equal as the object types, then you should be able to get the name of any of these objects

Boyan Angelov (Nemetschek Bulgaria)
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.
March 25, 2025

Hi @Marc - Devoteam ,

I use the Name attribute of the objects for the real name of the object, so I cannot place there the object type name. I do not want the users to have to select the object type name in an attribute when creating an object, but I cannot see how this can be done automatically, any ideas?

Marc - Devoteam
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.
March 25, 2025

Hi @Boyan Angelov (Nemetschek Bulgaria) 

Create extra object attribute under the existing object type and name the attribute as the object type, then you can use names of these attributes to fill a custom text field.

Boyan Angelov (Nemetschek Bulgaria)
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.
March 25, 2025

Let me see if I understand you correctly. The idea is to have an attribute of, let's say Text type, named the same as the Object type? How do I fetch that name in the postfunciton afterwards? The postfunction extract attribute values, not the name of the attributes, right? What am I missing here?

Marc - Devoteam
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.
March 25, 2025

Hi @Boyan Angelov (Nemetschek Bulgaria) 

If the attribute is a text field you should be able to get the value of that attribute.

Boyan Angelov (Nemetschek Bulgaria)
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.
March 26, 2025

Hi @Marc - Devoteam ,

I know that if I have a text attribute in the asset I can get the value of that attribute and copy it to a custom field. I am not sure though that I can make a text asset attribute that will have as value the name of the asset object type automatically, that is what I cannot figure out how to do.

Marc - Devoteam
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.
March 26, 2025

Hi @Boyan Angelov (Nemetschek Bulgaria) 

That is something you will have to put in manually or by import.

You can't set the object type name in an objects attribute automatically.

Boyan Angelov (Nemetschek Bulgaria)
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.
March 26, 2025

Yeah, that is what I feared as well. Thanks anyway, I will have to see what to do, seems like the manual job cannot be skipped here...

Like Marc - Devoteam likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events