Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Track errors in Forge app when console.log not allowed in Production

Vitheya Monikha October 28, 2025

Hi team,

We’ve developed and added a custom Forge app  as a plugin in Jira.
During development, we used console.log() statements for debugging and verifying function calls.

However, once the app is deployed to Production, we’re unable to use console.log() for tracking errors or debugging because logs aren’t visible or allowed.

Could someone please help clarify:

How can we access logs for our Forge app once it’s deployed (especially in Production)?

Is there any recommended method to track which method or function is failing when errors occur?

Are there alternatives to console.log — such as Forge’s built-in logging or error tracking — that can be safely used in Production?

Any guidance or best practices for logging or monitoring Forge apps in Jira Cloud would be greatly appreciated.

Thanks in advance!

1 answer

0 votes
Vikrant Yadav
Community Champion
October 29, 2025

Hi @Vitheya Monikha  On Frontend side you can use console.error to track the logs for your production deployment. 

From Developer Console, you can check those logs. 

Screenshot 2025-10-29 at 3.31.53 PM.png

 

For Better solution, I suggest you post Forge query on Developers Community : https://community.developer.atlassian.com/

Vitheya Monikha October 31, 2025

Hi @Vikrant Yadav ,

Thanks for the guidance! I’ve added console.info statements in my code. I can see the logs appearing in my VS Code terminal, but they don’t show up in the browser’s developer console. I’ve attached a screenshot and a sample code snippet for reference. Could you please take a look and help me understand why the logs aren’t appearing in the developer console?

 

Code snippet

resolver.define("createTestCase", async ({ payload }) => {
  console.info("createTestCase resolver called with payload:", payload);

  try {
    const { fields } = payload;
    console.info("Extracting and structuring field data for issue creation...");

    const storedData = {
      fields: {
        [fields.automatedKey]: fields.automatedVal,
        [fields.platformKey]: fields.platformVal,
        [fields.testStatusKey]: fields.testStatusVal,
        [fields.testTypeKey]: fields.testTypeVal,
        [fields.folderKey]: fields.folderVal,
        [fields.requirementLinkKey]: fields.requirementLinkVal || "",
        [fields.requirementIDKey]: fields.requirementIDVal || "",
        [fields.requirementDescKey]: fields.requirementDescVal || "",
        "description": fields.description,
        "issuetype": fields.issuetype,
        "priority": fields.priority,
        "project": fields.project,
        "assignee": fields.assignee,
        "summary": fields.summary,
      }
    };

    const projectId = fields.project.id;
    console.info(`Target project ID: ${projectId}`);

    console.info("Authorizing user to check project permissions...");
    const auth = authorize();
    const canCreate = await auth.onJiraProject(projectId).canCreateIssues();

    if (!canCreate) {
      console.error(`Permission denied: User cannot create issues in project ${projectId}`);
      throw new Error("Forbidden: You do not have permission to create issues in this project.");
    }

    console.info("Permission verified. Proceeding to create Jira issue...");

    const response = await api.asApp().requestJira(route`/rest/api/3/issue`, {
      method: 'POST',
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(storedData)
    });

    console.info("Jira API request sent. Awaiting response...");
    const data = await response.json();

    if (!response.ok) {
      console.error("Jira API returned an error:", {
        status: response.status,
        statusText: response.statusText,
        data
      });
      throw new Error(`Jira API Error: ${data.errorMessages ? data.errorMessages.join(', ') : 'Unknown error'}`);
    }

    console.info("Issue created successfully in Jira:", data);
    return data || null;

  } catch (error) {
    console.error("Error in createTestCase resolver:", error);
    return null;
  }
});

Logs Screenshot 
Screenshot 2025-10-31 172608.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events