Get workflow transition rule configurations

{
“errorMessages”: [
“Only apps can access this resource.”
],
“errors”: {}
}

i am not getting how i get response always getting this same response can anyone help how can i access this resource using forge but i didn’t get how forge work

The API reference has an example for Forge. Maybe if you include more details about what you’re trying to do someone will have more insight.

1 Like

I guess you currently call the API with asUset, but maybe you need to call it asApp.

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

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 you shouldn’t be trying to access the URL directly, only through Forge or Connect apps.

i am using language ruby and still now i didnt get now i can call this can u elaborate more it would be helpful for me

Welcome to the Atlassian developer community @jaygami,

You originally posted in the “Forge” category. When the API responds, “Only app can access this resource,” it’s a reference to Atlassian Forge, our Cloud-hosted platform for building extensions to Jira (and other products). This API and a handful of others are only available if you are building an app.

Unlike the Ruby code you would build & run locally, Forge is built with JavaScript and runs on Atlassian infrastructure.

i have created one forge app app deploy in jira instance after that how to call that because i am new to this so ididnt understanding how it work can u provide some steps or example site link from where i can see this

@jaygami,

The first thing to understand is that all Forge apps have 2 important steps:

  • deployment to put your code into the Atlassian infrastructure
  • installation to authorize an app to access a specific site

While developing the app, you can run this flow from the Forge CLI. Later, as a more production-oriented way, you can obtain an installation link, or have customers install from Marketplace.

Once installed, accessing the app will depend on which modules you have used. For example, the Jira tutorial focuses on the jira:issuePanel so it will show up on Jira issues.

okay thank for your help