Hi, I am trying to use the REST API to get the name of a project, given that we have its key. I am using the Get Project request. As far as I understand, I should be able to make the following request URL in order to get just the name of the project:
https://my-domain.atlassian.net/rest/api/3/project/myKey?properties=name
However, it just returns all of the same properties that I get if I just use that same URL without the query e.g. lead, components, issues etc. rather than just the name. I have also tried using "fields" as a query parameter in place of "properties". How can I get the API to just return a specified field only?
Hi @Joseph Robbins Welcome to Atlassian Community!
Name is in the root of the json content. You can directly parse project name using {{name}}.
You won't get name only via API. In the application where you are using the API, you need to parse http response and get project name.
Thanks,
V.Y
Ok that is fine, thanks for the quick response! My confusion came from the description of the "properties" query parameter in the api reference for "Get Project" which reads "A list of project properties to return for the project.". I am not experienced with REST so I just assumed that meant I could choose which properties the http response would contain. Thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're Welcome :)
Glad to hear I am able to help you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.