Hello Atlassian Community,
I am facing an issue when trying to retrieve user email information from Assets in Jira Service Management (JSM) via the REST API. Below is a detailed description of the problem and the steps I've taken so far:
Problem: I am trying to fetch user details, specifically the email, from an object in Jira Service Management's Assets. Although I am able to successfully retrieve the workspace ID and the objects within the workspace, I am encountering a 404 Not Found
error when attempting to access the attributes of the objects, including user-related information (such as email addresses).
I am using a script to interact with the Assets API. The workspace and object ID are correctly recognized and retrieved, but when trying to access the attributes of a specific object (e.g., with object ID 79
or 80
), the following error is returned:
GET request to /rest/servicedeskapi/assets/workspace/111111-1111111-11111111-11111/v1/object/79 returned an error code: status: 404 - Not Found
Steps Taken:
Workspace Recognition:
I can successfully list the available workspaces in JSM using the /rest/servicedeskapi/assets/workspace
endpoint, and I verified that the workspace ID 111111-111111-111111-111111 fe
is correctly returned.
Example response:
{
"size": 1,
"start": 0,
"limit": 50,
"values": [{"workspaceId": "11111-11111-11111-11111"}]
}
Object Retrieval:
I can successfully list objects in the workspace using the /rest/servicedeskapi/assets/workspace/{workspaceId}/v1/object
endpoint. However, when trying to access a specific object (e.g., object ID 79
or 80
) with the /rest/servicedeskapi/assets/workspace/{workspaceId}/v1/object/{objectId}/attributes
endpoint, I get a 404 Not Found
error.
Admin Privileges:
The user executing the API request has been confirmed as a Jira Admin, but the issue persists. I verified that the user has the necessary permissions to access the object and its attributes.
Error Response: The error message returned when attempting to fetch the object’s attributes is as follows:
GET /rest/servicedeskapi/assets/workspace/111111-111111-1111111-1111111/v1/object/79 returned an error code: status: 404 - Not Found
body: java.lang.RuntimeException: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
This error seems to indicate that the request is returning HTML instead of the expected JSON data.
If I use this script the workspace is shown in the logs well
What I Have Tried:
Verified Workspace and Object ID:
I have double-checked the workspace and object IDs and confirmed they are correct.
Permissions:
I’ve ensured that the user running the script has full admin access and the correct permissions to access Assets data.
Endpoint Check:
I have also tested the endpoints in Postman and get the same 404 error, which indicates that it is not an issue with the script itself.
What I Need Help With:
Why am I getting a 404
error when attempting to access the object’s attributes, even though the workspace and objects are correctly identified?
Are there any additional permissions or settings in JSM that I might need to configure to access user data (like email addresses) in the Assets API?
Could there be a configuration issue with the Assets API or something specific about the workspace or object that is preventing access to the attributes?
I am looking forward to your insights or suggestions to resolve this issue. If you need any more information or logs, feel free to ask.
Thank you for your help in advance!