I need to get the value of the personal property bossusername of the user test (as in the screenshot).
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.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the use of having two different kinds of properties? I wanted to create some through the UI and then get them with the API but they actually are two different objects. Not very convenient.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And what would be the purpose of custom values and not having access to them via API? It looks like you expect our automation to go into the GUI, look at that and say OK, so this is the data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does anyone knows how could you add/change a property of more than 5k users in your instance without the API supporting this?
I mean, please don't tell this is a manual task that I have to perform for each user...
Thanks in advance for any guidance!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Frederick Claudino you could use a software/code/library meant to automate browsers.
Open this page https://comutitres.atlassian.net/secure/admin/user/EditUserProperties.jspa?accountId=<accountId> for each user in your list and change/add a property.
Windows PowerAutomate can be the tool (if has a nice GUI).
I personally use Python and Selenium for that purpose, other javascript based packages exist.
In whatever case, this will be about building a custom script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.