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.

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

Rest API for user properties

Hauke Gulich February 25, 2019

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

 

2 answers

1 vote
Harit Prasad
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 10, 2020

Hello Hauke,

    Now, you able to fetch user property "phone"

1 vote
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 25, 2019

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:

Get User properties

Let me know if this information helps, Hauke.

Hauke Gulich February 26, 2019

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)

withoutuser.jpg

It says that username oder userKey are required - so I added the parameter

withuser.jpg

It says that the property "phone" does not exists, but when I open the user properties of hgulich it is like this:

 

userproperties.jpg (sorry for german screenshots)

I don't get it :-(

Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2019

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.

Hauke Gulich February 26, 2019

Hello Petterson,

 

thanks for your support. I get the following result (kind of strange result)

allProperties.jpg 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?

Saif August 7, 2019

I encountered the same use_Case/problem. I have no idea what "lastViewedVignette" means? help?

Suggest an answer

Log in or Sign up to answer