Closed littlespice33 closed 10 months ago
Workaround for me was to use axios and just make a request to the JIRA rest API:
await axios.put(
`${process.env.ATLASSIAN_API_HOST}/rest/api/2/issue/${issue.key}`,
{
update: {
fixVersions: [{ add: { name: version.name } }],
},
},
{
headers: {
'Content-Type': 'application/json; charset=utf-8',
Authorization: `Basic ${Buffer.from(
`${process.env.ATLASSIAN_EMAIL}:${process.env.ATLASSIAN_API_TOKEN}`,
).toString('base64')}`,
},
},
)
Hello @littlespice33! I finally got to your issue. It looks like you've messed up the API a bit and you need to use editIssue
instead of setIssueProperty
The example:
client.issues.editIssue({
issueIdOrKey: issue.key,
update: {
fixVersions: [{ add: { name: version.name }}]
},
});
That did indeed work! Sorry I got lost in the sauce of the documentation and I feel I should have been able to find that function myself. Thank you!
It's okay, thank you for question!
I'm working on a script that creates a version and then assigns that as the fixVersion to many issues. I can't figure out a way to assign the fixVersion and the documentation hasn't helped me out much (or I've been looking in the wrong spots), I tried checking it out at https://mrrefactoring.github.io/jira.js/classes/Version3.IssueProperties.html#setIssueProperty and it only accepts an issue key and a property name but it doesn't allow for a value.
I also tried to check out https://mrrefactoring.github.io/jira.js/interfaces/Version3.Version3Parameters.BulkSetIssuesProperties.html a but couldn't figure out what to put inside the
properties
object in order to properly set the fixVersion.What am I missing? Does this feature exist yet?