https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-group-workflow-transition-rules
https://jay.atlassian.net/rest/api/3/workflow/rule/config?=postfunction
using this i am trying to fetch workflow rules
but i get
{“errorMessages”:[“Only apps can access this resource.”],“errors”:{}}
but i didn’t know how i get this api response it would be better if you provide some guidence or step or some type of resource
@jaygami ,
Can you explain how you are authenticating to that REST API?
i am using curl code from my commandline but it get error “Only apps can access this resource”
You shouldn’t be using curl for this endpoint:
Using Forge, it would be something like this:
import api, { route } from "@forge/api";
const response = await api.asApp().requestJira(route`/rest/api/3/workflow/rule/config?types= postfunction`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Note that the URL you posted is missing types, so it’d be https://jay.atlassian.net/rest/api/3/workflow/rule/config?types=postfunction, but y…
1 Like
@jaygami ,
To elaborate @AaronCollier , not all endpoints provide all forms of auth. In this case, auth is only provided through Forge and Connect . API tokens and basic auth won’t work; hence, no curl.
1 Like