@docupace/pipeline 1.0.35-matttest.2 → 1.0.35-matttest.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docupace/pipeline",
3
- "version": "1.0.35-matttest.2",
3
+ "version": "1.0.35-matttest.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -254,14 +254,24 @@ program
254
254
  const url = `/rest/api/2/issue/${jiraTicketId}`;
255
255
  console.debug('url: ', url);
256
256
 
257
- // Step 3: Fetch Jira ticket information
258
- const jiraTicketData = await makeJiraRequest(
259
- url
260
- );
257
+ const jiraBaseUrl = 'https://docupacellc.atlassian.net';
258
+ const jiraEmail = process.env.JIRA_API_EMAIL;
259
+ const jiraApiKey = process.env.JIRA_API_KEY;
260
+ const jiraFullApiKey = `${jiraEmail}:${jiraApiKey}`;
261
+ const jiraUrl = `${jiraBaseUrl}/rest/api/2/issue/${jiraTicketId}`;
262
+ const jiraResponse = await fetch(jiraUrl, {
263
+ headers: {
264
+ Authorization: `Basic ${Buffer.from(jiraFullApiKey).toString('base64')}`,
265
+ 'Content-Type': 'application/json',
266
+ },
267
+ });
261
268
 
262
- if (jiraTicketData.fields.customfield_10107?.value !== 'Product') {
263
- throw new Error('Issue Type of Work must be Product');
269
+ if (!jiraResponse.ok) {
270
+ throw new Error(
271
+ `Failed to fetch Jira ticket. Status: ${jiraResponse.status}`,
272
+ );
264
273
  }
274
+ const jiraTicketData = await jiraResponse.json();
265
275
 
266
276
  const jiraSummary = jiraTicketData.fields.summary;
267
277
 
package/src/next/jira.js CHANGED
@@ -74,10 +74,7 @@ export async function updateComponentVersion(issueKey, packageName, version) {
74
74
  */
75
75
  export async function makeJiraRequest(endpoint, options = {}) {
76
76
  try {
77
- const response = await jiraClient.get({
78
- url: endpoint,
79
- ...options,
80
- });
77
+ const response = await jiraClient.get(endpoint, options);
81
78
  return response.data;
82
79
  } catch (error) {
83
80
  console.error(`Error making Jira request: ${error.message}`);