Comments (3)
i must have stared at this too long, and got the opts format wrong above (i think)...i had opts.transition vs opts.issue.transition per function signature/docs. however, this still didn't do it (get 200 OK w/o transition, only comment appears):
const opts = {
issueKey,
issue: {
update: {
comment: [
{
add: {
body: 'Test automated comment',
},
},
],
},
transition: {
id: '21',
},
},
}
i've verified the transitionIds via https://${jiraHost}/rest/api/2/issue/${issueKey}/transitions?expand=transitions.fields
. it seems others have problems with transitions using PUT vs POST as well:
- https://community.atlassian.com/t5/Answers-Developer-Questions/JIRA-REST-API-For-Transitions-not-working/qaq-p/488693
- https://community.atlassian.com/t5/Jira-questions/JIRA-How-to-change-issue-status-via-rest/qaq-p/528133
- https://community.atlassian.com/t5/Jira-questions/REST-API-Transition-Change-Status-Issue-Jira-Desk-Service/qaq-p/1160888
for now, i've created a helper function that just uses request to handle transitions (should something like this be added as transitionIssue
?):
const transitionIssue = async ({ ...args }) => {
const { transitionId, issueKey } = args
const jsonData = `{
"transition": {
"id": "${transitionId}"
}
}`
const opts = {
method: 'POST',
url: `https://${jiraHost}/rest/api/2/issue/${issueKey}/transitions`,
auth: {
username: process.env.JIRA_USERNAME,
password: process.env.JIRA_PASSWORD,
},
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: jsonData,
}
try {
await request(opts)
} catch (e) {
throw new Error(e.message)
}
}
from jira-connector.
while refactoring some related code, i had a chance to circle back and give this another try. despite my opts.issue.transition looking ok per jira rest docs, it never seems to work with editIssue. i can curl just fine, but need to POST to transitions endpoint vs editIssue's PUT. do you have a good example of how to make this work with editIssue? it would be awesome to be able to remove my one-off request-based function just for transitioning. TIA!
from jira-connector.
not sure how i missed transitionIssue when i first searched the repo (saw it in docs but not issue.js :-( ) -- sorry for the noise. i never could get a transition to work with editIssue, but just using addComment + transitionIssue now which is A-O-K.
from jira-connector.
Related Issues (20)
- Search query is not works HOT 1
- You should commit lock files
- types not found HOT 2
- Support for Development Information API
- Cannot add actors to the given role
- Uncaught TypeError: Cannot read property '2' of null
- Error message using the Jira connector / Sharepoint SPFx HOT 10
- board.createBoard returning java errors HOT 2
- Issue apis not working.
- OAuth2 support
- Thank you!
- Cannot get licensing information for addon HOT 1
- Is Jira-connector compatible with Jira Service Desk APIs?
- New version is not working with TypeScript without esModuleInterop but there is no warning
- Cannot access filter createFilter method
- Search Functionality and the Ampersand HOT 1
- 429 too many request on a single search request
- project.getComponents -> 404 error
- Access Jira server with self-signed certificate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jira-connector.