Background
I’m working with two separate projects:
EngineeringTeam ProjectCustomerCareTeam 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?