Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hello everyone,
we are using service desk and want to make the phone numbers of the customers visible to the agents. Therefore I thought about adding a user property to each customer (key = phone, value = number). Because we do have a bunch of customers, I wanted to create a small application for fast entering phonenumbers. So I thougt about using the REST API to get all customers without the property "phone", but I can not read the properties correctly by REST.
https://myURL/rest/api/latest/user/properties/phone?username=myUsername
I will receive the error message that the property phone does not exists. I also tried
https://MYURL/rest/api/latest/user/properties?username=myUserrname
but the result is like this:
{
"keys": [
{
"self": "https://MYURL/rest/api/2/https://MYURL/rest/api/2/user/properties/lastViewedVignette?userKey=MyUsername",
"key": "lastViewedVignette"
}
]
}
Are these different properties than I can add in the user administration screens? I also used my administration account for the rest call.
Thanks,
Hauke
Hello Hauke,
Now, you able to fetch user property "phone"
Hello Hauke,
The correct Endpoint to get user's property using REST API Call would be:
GET /rest/api/3/user/properties/{propertyKey}
You can check the following REST API to know more details about it:
Let me know if this information helps, Hauke.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Petterson,
thanks for your reply but that is not working for me. Here is what I did (same you put, but not /3 - I needed to put version "2" instead (my Jira is 7.12.1)
It says that username oder userKey are required - so I added the parameter
It says that the property "phone" does not exists, but when I open the user properties of hgulich it is like this:
(sorry for german screenshots)
I don't get it :-(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Hauke,
This is odd. What property keys are returned when you run the query below for the user hgulich?
GET /rest/api/2/user/properties
If it returns any keys, try to put it in the URL using the same format.
Analyzing the Rest API documentation for JIRA 7.12, I also found the following warning:
Returns the value of the property with a given key from the user identified by the key or by the id. The user who retrieves the property is required to have permissions to read the user.
Can you double-check if you are running the REST API with the same user you are using to check the user properties in the UI?
We will be waiting for your answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Petterson,
thanks for your support. I get the following result (kind of strange result)
I have no idea what "lastViewedVignette" means. I am using hgulich to authorize against the REST API. Do I have to use a different authentification type?
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.