How to sync issue status between two different projects when status fields are separate

Background

I’m working with two separate projects:

  • Engineering Team Project
  • CustomerCare Team Project

When a customer submits a ticket, it gets created in the CustomerCare project first. Then the system automatically generates a linked ticket in the Engineering project with proper labels.

The engineering ticket has a title format like <customer-ticket-title>/<customer-ticket-number>.

Right now I can’t get automatic status updates flowing from the Engineering project back to the CustomerCare project when developers change ticket status.

What I Need

Our dev team only looks at tickets in the Engineering project. I want status changes there to automatically update the matching ticket in the CustomerCare project.

Both projects need to keep their own separate status workflows.

Current Code

After doing validation checks and getting the target ticket ID, I’m using this code block to update status:

// this approach works fine
try {
  // Check if current status is 'Testing-Complete' and change it to 'Ready for Deploy'
  if(ticket.fields.Status.name === "Testing-Complete") {
    console.log("updating status field...")
    linkedTicket.fields.Status = ctx.CustomerSupport_Status["Active"];
  }
} catch(error) {
  console.log(JSON.stringify(error));
  console.log("Something went wrong here...");
}

Here’s my requirements config:

requirements: {
  Engineering_Status: {
    name: "Status",
    type: entities.Status.fieldType,
    TestingComplete: {name: "Testing-Complete"},
    "Ready for Deploy": {name: "Ready for Deploy"},
    Active: {name: "Active"},
    "Review-Done": { name: "Review-Done" }
  },
 
  CustomerSupport_Status: {
    name: "Status",
    type: entities.Status.fieldType,
    TestingComplete: {name: "Testing-Complete"},
    "Ready for Deploy": {name: "Ready for Deploy"},
    Active: {name: "Active"},
    "Review-Done": { name: "Review-Done" }
  },
  
  main_project: {
    type: entities.Project,
    name: 'Demo Project Sept 2024'
  }
}

When It Works

Everything works perfectly when both the Engineering and CustomerCare projects use identical status field configurations.

The Problem

But when each project has its own independent status fields, the try-catch block fails with an error. The weird thing is that the error object comes back as undefined so I can’t figure out what’s actually going wrong.

Current Workaround

Right now I have to make both projects use exactly the same status values, but this isn’t really practical for our workflow. Anyone know how I can make this work with separate status configurations?

You’re hitting a status validation conflict. The system can’t assign a status from one project’s workflow to another project that doesn’t recognize that status value. When you call ctx.CustomerSupport_Status["Active"], that exact status needs to exist in the target project’s workflow. I’ve run into this cross-project sync issue before. You need a status mapping function that translates between the two workflows. Don’t assign status values directly - map the Engineering project status to whatever CustomerCare project uses instead. Say Engineering has “Testing-Complete” but CustomerCare uses “Pending-Review” for the same thing. Your code should detect the Engineering status and assign the CustomerCare equivalent. First query the target project’s available statuses, then apply the mapped value. That undefined error? The assignment’s failing silently because the target project is rejecting an invalid status. Add some logging to see what statuses are actually available on the CustomerCare project before you try the assignment.

I hit the same issue when connecting our support and dev workflows. Your requirements config is pointing status references to the wrong project context. When you define Engineering_Status and CustomerSupport_Status with identical names, the system can’t tell which project’s status objects to actually use.

Skip the config mappings and query the CustomerCare project directly for its statuses at runtime. Try const customerCareStatuses = await entities.Project.findByName('CustomerCare').getStatuses() then grab the status you need from that collection. You’re assuming both projects share the same status entity references - they don’t. Each project has its own status workflow with unique internal IDs.

Also check if linkedTicket has proper write permissions. Sometimes tickets load fine for reading but can’t be updated, causing silent failures. Add a permission check before the status update to rule that out.

The silent failure happens because the target project’s validation layer is rejecting your status assignment. I’ve seen this with cross-project syncs where the API gives you zero useful error feedback. Your requirements config is fine - the real issue is you’re treating status values like simple strings when they’re actually complex objects tied to specific project workflows. Even if CustomerCare has an “Active” status, it won’t accept the status object from Engineering’s workflow. Don’t map statuses in your config. Create a lookup table that maps Engineering status names to CustomerCare status names instead. Then use the target project’s status collection to grab the actual status object you need. Something like const targetProjectStatus = linkedTicket.project.findStatusByName(mappedStatusName) works way better than trying to reference statuses through your context config. Also make sure linkedTicket is fully loaded with project info before you try the update. Sometimes the linked ticket object comes back missing proper project context, which makes the status assignment fail validation silently.

You’re getting undefined because you’re trying to assign a status object that doesn’t match the target project’s workflow schema. Even when both projects have statuses with identical names, they’re completely different entities with different internal IDs.

I hit this exact issue last year with multiple teams on separate Jira instances. The fix is simple - fetch the actual status object from the target project instead of referencing your config.

Here’s what works:

try {
  if(ticket.fields.Status.name === "Testing-Complete") {
    console.log("updating status field...")
    
    // Get the actual status object from the target project
    const targetStatus = linkedTicket.project.statuses.find(s => s.name === "Active");
    
    if(targetStatus) {
      linkedTicket.fields.Status = targetStatus;
    } else {
      console.log("Status 'Active' not found in target project");
    }
  }
} catch(error) {
  console.log("Error details:", error.message);
}

Now you’re using CustomerCare’s actual status object instead of forcing Engineering’s status reference.

This walkthrough covers the technical details for syncing between different Jira setups:

The undefined error’s probably happening because your status assignment fails validation, but the API doesn’t throw a proper exception. Add some debug logging before the assignment to see what ctx.CustomerSupport_Status[“Active”] actually returns - I bet it’s null or pointing to the wrong project. Also check if the linked ticket loaded properly before updating it. Sometimes the ticket object comes back incomplete.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.