Open pnispero opened 3 days ago
Update
Update
There are 2 options for authorization:
PAT is the method suggested from JIRA administrators, and for good reason. It boils down to PAT's are more simple, easier to manage, and perfect for CI/CD for just issue creation/reporting. Whereas OAuth is overkill for what we would be using it for and has more complexity and overhead.
Update
We are going with PAT. And requested for a psuedo user account adbuild
on Jira - ticket.
adbuild
account, we can create a PAT for that and store it in the backend vault.adbuild
group which has the adbuild
user that'll give it permissions to create/modify issues. adbuild
with only one user adbuild
because a group uses the same permissions globally, whereas a user can be configured for each project
bs create issue
would need to specify cater ID as normal, but also what Jira project. Alternatively we can have the Jira project in the component db and just use that.bs create branch
, and a branch is always a fix
, feat
, or dev
. If its a fix or feat
, then user must provide issue number
, and in the case of Jira, the issue number is the project-key-#
like EEDSWCM-7
. And having that info is all we need to know what issue in Jira is the branch associated with.Sample curl request to create an issue
curl -X 'POST' \
"https://jira.slac.stanford.edu/rest/api/2/issue/" \
-H "Authorization: Bearer <PAT>" \
-H "Content-Type: application/json" \
-d '{
"fields": {
"project":
{
"key": "EEDSWCM"
},
"summary": "Testing Jira API.",
"description": "Creating of an issue using project keys and issue type names using the REST API",
"issuetype": {
"name": "Task"
}
}
}'
Response:
{"id":"79423","key":"EEDSWCM-86","self":"https://jira.slac.stanford.edu/rest/api/2/issue/79423"}
Bug tracking issue creation - JIRA
Research
Look into how we can implement JIRA to create issues add comments etc.
TODO