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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,455,915
Community Members
 
Community Events
176
Community Groups

How to allow/restrict a user to update a certain attribute on a specific object?

Edited

We have an object type called "User". One of the attributes on this object type is called "Work place". The value of this attribute should be maintained (selected) by the user itself. None of the others attributes should be editable by these users. Also, the user should only be able to edit the object representing the current user.

I.E. Tom Bombadil should only be allowed to edit the object the attribute "Workplace" on object "Tom Bombadil" etc., and not the object "Slart I. Bartfast".

(The "User" object type have another attribute that is mapped to the Jira user. The attribute "Work place" is a reference to another object type consisting of all the work places in our organization.)

I think achieving this restriction is not possible within Insight itself.

But maybe I could have a request in the Jira Service Desk Portal containing the Insight Custom Field "Work place", where the user would pick his work place from the list, and then having a post function to update the object of the current user?

Or is there another way maybe?

2 answers

1 accepted

0 votes
Answer accepted

Hi Johannes.

As you noted, Insight by itself does not yet support Attribute Permissions, only Object Type level permissions.

We do have several Feature Requests which you can vote on - to have these Permissions.

As for the use of Postfunction - yes, this should work:

  1. On a Transition Screen; have the Insight Object CF "Work Place" to be populated by the User from the available "Work Places" Objects (note that you can limit the list by your CF IQL filters).
  2. You should then have another Insight CF on this Issue (it can be hidden in the Transition) with a Filter Scope: objectType = "User", Filter Issue Scope and Filter Assign Scope (Strict = True) like: "Jira User" = ${reporter} //assuming the "Jira User" Attribute is the Attribute of "User" that is mapped to the Jira User related to this "User" Object.
  3. Use the Postfunction: Change Insight Value into Insight Object  where the Source CF is "Work Place", the Change Type is "Set", and the Target CF is where the "User" object is Populated.
  4. Alternatively, you can use Set the value of an object attribute with a predefined value: Where the Source CF is where the "User" Object is populated, the Attribute to be populated is the "Work Place" Attribute, and the Predefined value is a placeholder for the "Work Place" CF, e.g. ${Work Place}.
  5. Note that for this to work correctly - the Postfunction should be placed LAST in the postfunctions Order - so that the User CF will be populated first, then the selected User Objects will have its Attribute Set accordingly.

Please let us know if you require additional information.

Kind regards,

Yinon

Team Riada

This works perfect, and no scripting required:)

Thanks!

0 votes

I am trying to do what I described above; having a request presenting the user with a drop down list of "Work place" (Insight custom field), and then running an Insight post function setting the chosen "Work place" as the new attribute value on the curent user, but I can not make it work.

I am using this script as basis:

https://documentation.riada.io/insight/latest/insight-advanced-usage-guide/insight-for-developers/groovy-scripting/groovy-script-examples/post-functions/update-object-attribute

Which of the Insight post functions should I use?

https://documentation.riada.io/insight/latest/insight-administrator-s-guide/insight-workflow-functions/insight-post-functions

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events