Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to get this user property from jira API?

I need to get the value of the personal property bossusername of the user test (as in the screenshot).

lastttt.png

I found an api method to get personal properties of users:

[GET] {url}/rest/api/latest/user/properties/bossusername?username=test

but this method finds nothing.

Then, I decided to create another user-property using the API method:

[PUT] {url}/rest/api/latest/user/properties/newprop?username=test

JSON BODY: "newprop"

now i can get the value of this property via API, but it is not visible through the UI.

It turns out these are two different custom properties that do not see each other. Now I need to add a property through the API so that it can be seen in the GUI.

1 answer

Hello @Dmitrii Strukov 

That screenshot you've provided looks like the user properties screen for their Jira account. Those are not the same user properties that are used by Jira Server that you can access via the REST API.

When you use:

[GET] /rest/api/2/user/properties?username=test

Does the API return 'bossusername' in the list of available properties for that user?

If not, then you are confusing the two types of 'user properties'. Although it's not stated on the older Jira Server v2 documentation, the Jira Cloud v3 REST API documentation explains this:

Get user property

GET /rest/api/3/user/properties/{propertyKey}

Returns the value of a user's property. If no property key is provided Get user property keys is called.

Note: This operation does not access the user properties created and maintained in Jira.

And, if you go to the Update roles and properties for Jira users page, it also explains the same thing, in reverse:

These user properties are not the same as the user properties accessed via the REST API.

The only way to read or change those user properties like bossusername is via the GUI. If you did create a new property called newprop for that user test in Jira Server, then it will never show up on that screen you have provided.

Tell me please, and what is the API to use to manipulate the custom properties that are visible in the GUI?

Hello @Dmitrii Strukov 

Please read my answer again. You cannot use the REST API to change those custom properties visible in the GUI.

Please read the Update roles and properties for Jira users page, where it also explains the same thing, that you must use the GUI. From that page:

To add data to user properties:

  1. Go to your site's Admin at admin.atlassian.com. If you're an admin for multiple sites or an organization admin, click the site's name and URL to open the Admin for that site.
  2. From the Users page, select the user whose data properties you want to set.
  3. Click the More options button to the right of Log in as user and select Edit Jira properties.
  4. Enter the Key and Value for the user and choose Add.

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you