There is a attribute of User type Link User which is configured using some aql queries in a custom field ,I want to make the automation that whenever new asset came in object schema the assigned user get automatically filled with the last user from the property of the asset object
@Ravi Sagar _Sparxsys_
Hi @Anupamshaw
I'm not 100% certain, that I got what you are trying to do, so I'll rephrase your problem in my own words and try to give a solution for that. The problem: Whenever a new asset of a given type is created, look at the last object of said type and copy the value of the "Link User" attribute in that asset to the newly created one. Is that correct? If yes, you can achieve this behavior by creating a rule via the global automation setup. Use the "Object" trigger, and configure it to listen for creations on a given scheme.
Next, you will need to use the "Lookup Objects" action with the following configuration (change to your scheme). `objectType = {{object.objectType}} AND "Link User" is not EMPTY order by created desc`
With this, you can use the `{{lookupObjects}}` smart value, to access the objects you just searched for.
Next, you can edit the object that was created by using the "Edit Object" action and use this smart value to set the "Link User" attribute: `{{lookupObjects.first."Link User".accountId}}`
Hope this helps.
Greetings
Gideon
Hi @Gideon Nolte _Eficode_ The above solution which you suggested i am not able to get a desired output,Please ,Let me explain you from the very beginning ,there is a Last user attribute field in the asset object whenever we run a discovery import you can refer the above image below the vendor property the last user is coming it is basically the system name of the user of the device,And there is a list of user in the jira admin portal where the name and email id is present of the user ,I want to make a automate flow of mapping a link between the last user of the asset to the assigned to ,where 'assigned to' is the custom field which i have configued by following some aql queries.Means when new asset come to the schema the "assigned to " field will automatically filled by the last user name which is having some connection with the jira users that i wanted to do.hope i am now clear to youThanks and regard,waiting for your replyAnupam shaw
I think i get it, but I am not sure.You want to put a User (Jira user) into the "Link User" attribute of an asset based on the name of the user provided in the "Last User" attribute of said asset?
If yes, you might want to create a seperate object types for "Asset Users" which hold their name in one attribute and their account in another one. This way you could have an attribute on the asset referencing to an "Asset Users" object which you could fill during import with an aql import mapping like Name = ${Last User}.
Alternatively, you could use the Jira REST API via "Send webrequest" to search for a user by name (Last User) and use the accountId given in the response to set as the value for "Link User".
Hope this makes sense and helps.Greetings Gideon
hi @Gideon Nolte _Eficode_
Yes you are right i want this solution,but can u please add screen shot it would be great i am facing some diffulties it resolving it.Thanks and regardsAnupam shaw
It looks like you're new here. Sign in or register to get started.