I have created a forge App with a webtrigger and wrote a function which accepts a set of unique Id’s and return the email id’s from Jira. I see function is getting executed successfully and i can see the final response in the logging. But when it comes to the API end point output i see below error.
Error:
{“timestamp”:“2025-06-09T06:57:57.990+00:00”,“path”:“/x1/x5jmVL4mS4Ndy5uOf7gRo27uAK0”,“status”:424,“error”:“Failed Dependency”,“requestId”:“a8a36d96-5771026”}s
Curl command:
curl --location --request POST ‘https://79697648-7256-40d6-85a3-c3ff9824c642.hello.atlassian-dev.net/x1/x5jmVL4mS4Ndy5uOf7gRo27uAK0’ --header ‘X-Api-Key: 1234’ --header ‘Content-Type: application/json’ --data-raw ‘{
“accountIds”: [
“712020:d262d596-7000-46f2-9d1a-ca4d7c206f55”,
“712020:36bfb1d9-4d63-4ad4-8ff4-37000ec76e76”
]
}’
Hi,
In my case, when I see this error, one of those 2 solve the problem:
- restart forge tunnel (if you are using one) - sometimes forge tunnel is not stable
- regenerate webtrigger url for your particular environment and re-deploy
Hope this will help
Hi
Solution :
Even I faces this While working on web trigger .
Only we have to send response in specific format
Example:
manifest.yml
webtrigger:
- key: testing-api
function: TESTING-api
response: dynamic data by default.
type: dynamic
function:
- key: TESTING-api
handler: testing.run #
Example Handler Function
testing.js
import api, { route } from "@forge/api";
// Resonse give correctly
export async function run(req) {
try {
console.log(" Webtrigger invoked: addAttachment (TEST MODE)");
// Step 1: Parse request
console.log(" Raw request body:", req.body);
// Step 2: Use dummy payload
const body = {
issueKey: "TEST-123",
fileName: "dummy.txt",
fileContentBase64: "ZHVtbXk=", // "dummy" in base64
};
console.log(" Dummy payload prepared:", body);
// Step 3: Prepare dummy Jira API response
const data = {
success: true,
status: 200,
attachment: {
id: "10001",
filename: body.fileName,
size: 123,
mimeType: "text/plain",
},
};
console.log(" Fake Jira response generated:", data);
// Step 4: Returning response
console.log(" Returning success response with status 200");
return {
statusCode: 200,
contentType: "application/json",
body: JSON.stringify(data),
};
} catch (err) {
console.error(" Error in addAttachment (TEST MODE):", err);
const errorData = {
success: false,
error: err.message,
};
console.log(" Returning error response with status 500");
return {
statusCode: 500,
contentType: "application/json",
body: JSON.stringify(errorData),
};
}
}
Also @BrettB here is detail solution for your request also:Webtrigger returning 424 Failed dependency
Do check and if Faced any issue let me know .Because its working for me
Thanks!!!
1 Like
thanks @NishantParaskar2 this worked.
Few changes as I’m using forge recent version 12.6.1
modules:
webtrigger:
- key: get-projects-trigger
function: get-projects
response:
type: dynamic
function:
- key: get-projects
handler: projects.run
app:
runtime:
name: nodejs22.x
memoryMB: 256
architecture: arm64
id: ari:cloud:ecosystem::app/xxxxxxxxxxxxxxxxxxxxxxxx
permissions:
scopes:
- read:jira-work
project.js file
import api, { route } from "@forge/api";
export async function run(event, context) {
try {
console.log("📡 Webtrigger called");
const response = await api.asApp().requestJira(route`/rest/api/3/project/search`);
if (!response.ok) {
console.error(`Jira API failed: ${response.status}`);
return {
body: { error: `Jira request failed: ${response.status}` },
statusCode: response.status,
contentType: "application/json",
};
}
const data = await response.json();
console.log("✅ Projects fetched:", data.total);
return {
body: JSON.stringify(data),
statusCode: 200,
contentType: "application/json",
};
} catch (err) {
console.error("❌ Error:", err);
return {
body: { error: err.message },
statusCode: 500,
contentType: "application/json",
};
}
}
this might help someone.