-
Type:
Bug
-
Resolution: Answered
-
Priority:
Low
-
None
-
Affects Version/s: 9.2.1
-
Component/s: REST API
-
None
-
Severity 3 - Minor
Issue Summary
This is reproducible on Data Center: (yes)
Currently below is the REST API to generate PAT tokens refer this
curl --request POST \ --url 'http://{baseurl}/rest/api/latest/access-token' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "daysUntilExpiry": 2154, "name": "token name", "permissions": [ "<string>" ] }'
The field daysUntilExpiry does not seems to be valid.
Steps to Reproduce
Use the above REST API to generate PAT tokens for a user.
Expected Results
The PAT token is generated for the particular user.
Actual Results
Below error is seen when running the REST API.
{"message":"Unrecognized field \"daysUntilExpiry\" (Class com.atlassian.bamboo.rest.model.accesstoken.CreateAccessTokenRequest), not marked as ignorable\n at [Source: org.apache.catalina.connector.CoyoteInputStream@856402d; line: 2, column: 26] (through reference chain: com.atlassian.bamboo.rest.model.accesstoken.CreateAccessTokenRequest[\"daysUntilExpiry\"])","status-code":400}
Workaround
Remove the field "daysUntilExpiry" and regenerate the PAT tokens.