Skip to content

Commit 6a59caa

Browse files
committed
fix jira
1 parent a576e8e commit 6a59caa

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

update_jira/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,10 @@ async function handlePushEvent(branch, jiraUtil, githubRepository, githubToken)
271271
)
272272

273273
console.log(`Staging deployment results: ${updateResults.successful} successful, ${updateResults.failed} failed`)
274+
return
274275
} else {
275276
console.log('No Jira issues found in staging commit history')
277+
return
276278
}
277279
} catch (error) {
278280
console.error('Error processing staging commit history:', error.message)

utils/jira.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class Jira {
232232
async findByStatus(status, maxResults = 100, fields = ['key', 'summary', 'status']) {
233233
try {
234234
const jql = `status = "${status}"`
235-
const response = await this.request('/search', {
235+
const response = await this.request('/search/jql', {
236236
method: 'POST',
237237
body: JSON.stringify({
238238
jql,
@@ -294,7 +294,7 @@ class Jira {
294294
async updateByPR(prUrl, newStatus, fields = {}) {
295295
try {
296296
let jql = `text ~ "${prUrl}"`
297-
const response = await this.request('/search', {
297+
const response = await this.request('/search/jql', {
298298
method: 'POST',
299299
body: JSON.stringify({
300300
jql,
@@ -650,14 +650,6 @@ class Jira {
650650

651651
console.log(`Updating ${issueKeys.length} issues to status: ${targetStatus}`)
652652

653-
console.log(issueKeys)
654-
655-
return {
656-
successful: false,
657-
failed: issueKeys.length,
658-
errors: [],
659-
}
660-
661653
const results = await Promise.allSettled(
662654
issueKeys.map(issueKey =>
663655
this.transitionIssue(issueKey, targetStatus, excludeStates, fields)

0 commit comments

Comments
 (0)