Forums

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

Asset type configuration: "User" = currentUser() not working

Gaizka March 31, 2020

Hi,

I've an Asset Type Configuration with this IQL expression: 

Status = ACTIVE AND (ObjectType = Laptops OR ObjectType = Printers OR ObjectType = Mobiles) AND "User" = currentUser()

Each user must see only their assets but it's not working.

I think the Asset Type Configuration takes the User that creates the rule, because everybody see the assets I see (rule creator).

Regards,

Gaizka

3 answers

0 votes
Tobbe September 25, 2024

anyone found an answer to this? Ive got the same issue. Im on DC and have a safed IQL filter I want to use on dashboard assets widget. It doesnt work with currentUser() on the widget but the filter works fine.

0 votes
Andrew Laden
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 31, 2020

In insight, did you define the property "User" as a user object?

Gaizka March 31, 2020

Attribute name is "Usuario".

Usuario.jpg

Gaizka March 31, 2020

In the IQL expression I've: "Usuario" = currentUser()

Andrew Laden
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 31, 2020

Re-read your question.

Just to make sure I understand. You have a saved IQL query with part of it being "Usario= currentUser()" but when other people use the query, they see your assets instead of thier own?

Any per your latest post, it work as expected when using the Insight Search page, but not elsewhere?

Can you show a screenshot of where it is not working? Not sure where you are trying to use it.

Gaizka March 31, 2020

Hi,

I've created an asset type configuration:

 

Conf.jpg

And I use it on a Custom field as explained here:

How to configure a custom asset field in Jira  

Regards,

Gaizka

Andrew Laden
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.
April 1, 2020

Hmm, I suspected it might be something like that. 

I would guess that the function is being evaluated at the time the asset type is being created, not at the time the custom field is displayed.

You may want to instead use a IQL in the custom field definition to filter the custom field by currentuser(). That is more likely (I would think) to get evaluated at display time.

That said, I realized I am on server and you are on cloud, so its likely there are difference in behavior I cant see. I'd raise this to insight support and see what they say.

Gaizka April 1, 2020

Thanks!!!

0 votes
Moses Thomas
Community Champion
March 31, 2020

@Gaizka   have you tried to  replace

  "User" = currentUser(),  with  assignee = currentUser()

Gaizka March 31, 2020

User is the name of the attribute on the Object Type.

Like FEDERICO SPAGOCCI likes this
Moses Thomas
Community Champion
March 31, 2020

@Gaizka  I see after reading the meaning of  about Object type attributes  for Insight  Asset management plugin for cloud below,

https://documentation.mindville.com/insight/5.4/insight-manager-s-guide/object-type-attributes

of course your query will not  work and does not make sense to use the query this way

THE OBJECT TYPE ATTRIBUTE "USER"

This type makes it possible to select a user from the selected Jira group and connect object/s with users.  It will make more sense  to add

  assignee = currentUser()

 This  means that  "Usuario"   is an object that allows you to choose users from a particular group .

Like FEDERICO SPAGOCCI likes this
Gaizka March 31, 2020

It works on the IQL search:

Usuario.jpg

Why not in the "Asset type configuration"?

Moses Thomas
Community Champion
March 31, 2020

@Gaizka  If it works here then should work every  where.  In the  configuration of Usuario   could you check which group is  defined ?  if  all users which you want them to  see all assets assign to  them belongs to  the group.  Then it should work for all users

Suggest an answer

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

Atlassian Community Events