@straiffi/archon 1.3.8 → 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5009,7 +5009,8 @@ app.post('/tickets', (req, res) => {
5009
5009
  }
5010
5010
  return bundle.id;
5011
5011
  }
5012
- return createAutoBundleForName(title.trim(), project.id).id;
5012
+ const autoBundleName = externalSource?.external_key ?? title.trim();
5013
+ return createAutoBundleForName(autoBundleName, project.id).id;
5013
5014
  })();
5014
5015
  const ticket = createTicketRecord({
5015
5016
  title: title.trim(),
@@ -5114,7 +5115,8 @@ app.patch('/tickets/:id', (req, res) => {
5114
5115
  if (req.body.worktree_bundle_id == null || req.body.worktree_bundle_id === '') {
5115
5116
  try {
5116
5117
  ensureProjectRootBundle(nextProjectId);
5117
- resolvedBundleId = createAutoBundleForName(title?.trim() ?? ticket.title, nextProjectId).id;
5118
+ const autoBundleName = ticket.external_source?.external_key ?? (title?.trim() ?? ticket.title);
5119
+ resolvedBundleId = createAutoBundleForName(autoBundleName, nextProjectId).id;
5118
5120
  }
5119
5121
  catch (error) {
5120
5122
  if (error instanceof HttpError) {
@@ -5137,7 +5139,8 @@ app.patch('/tickets/:id', (req, res) => {
5137
5139
  if (isProjectChanging && !hasBundleField) {
5138
5140
  try {
5139
5141
  ensureProjectRootBundle(nextProjectId);
5140
- resolvedBundleId = createAutoBundleForName(title?.trim() ?? ticket.title, nextProjectId).id;
5142
+ const autoBundleName = ticket.external_source?.external_key ?? (title?.trim() ?? ticket.title);
5143
+ resolvedBundleId = createAutoBundleForName(autoBundleName, nextProjectId).id;
5141
5144
  }
5142
5145
  catch (error) {
5143
5146
  if (error instanceof HttpError) {