Insight IQL: Restricting a fields values by current users group memebership

Peter Merkel _mgm-tp_ December 18, 2018

Hi,

I have a client that would like to migrate to Jira and use Insight for CMDB and Asset Management. I am currently trying to find out, whether it is possible to restrict the values of a Insight Custom field by a users group membership, or another attribute of that user. I did not find any solution or best practice yet, how to model such an approach.

To give a more tangible example:

I have for instance a company with two locations (A and B) and Jira users who work at location A or B. I have i.e. printers that also are located a one of the two locations modelled as objects.

customers requirement would be to have users at location A only being able to create issues with printers on A, and similary workers on B only for B.

what would a best practice, or simple solution look like?

(i could get user-locations from ad)

1 answer

1 accepted

1 vote
Answer accepted
Yinon Negev
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.
December 19, 2018

Hi Peter.

     Insight can restrict the Values available for selection in a CF using a Filter Issue Scope in the CF configuration. Using IQL, you filter the Objects available for selection according to the way they are related to the specific User.

Here are some simple examples (which can be extended and adjusted further - depending on requirements and implementation):

If you have a Laptop with an Attribute "Owner" of the Jira User Attribute Type, then simply configure the CF with objectType = "Laptop" and the Filter Issue Scope: "Owner" = currentUser() //or ${reporter}

If the "Owner" Attribute is a reference to a "User" Object type, which has a Jira User Type Attribute in it, then the Filter Issue Scope might be: object HAVING outR("Jira User" = ${reporter})

For the case you presented - depending on the way the relationship between Location and Printer is set; for example, each Location has a Jira Group including the Users belonging to this Location (a Group type Attribute) and a Printer is being referenced by a Location Object where it is installed (again - this structure is only for the sake of explaining IQL), then:

object HAVING inR("Group" HAVING user(currentUser()),"installed")

As said, these are just a few examples to answer your requirements.

Please see our Documentation for more information, and if required, we'll be happy to assist you if you'll submit a Support Request with us in https://portal.riada.io/

 

Kind regards,

Yinon

Team Riada

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events