Jira: Transition based on Name or ID
:warning: Note on feature completeness :warning:
We are narrowing the scope of acceptable enhancements to DefectDojo in preparation for v3. Learn more here: https://github.com/DefectDojo/django-DefectDojo/blob/master/readme-docs/CONTRIBUTING.md
Description
Describe the feature / bug fix implemented by this PR. fixes issue #3821 It adds a new variable that is used to specify the Jira Transition Name to transition to Closed state for a ticket. If that variable is specified, then "transition close id" in webui settings is ignored. Test results
Ideally you extend the test suite in tests/ and dojo/unittests to cover the changed in this PR.
Alternatively, describe what you have and haven't tested.
It was tested that a jira ticket, regardless of its status, is closed by using the transition name and automatically getting the transition id for each case. The only limitation is that a resolution doesn't have to be set (this is an intended behaviour as per current Jira integration design).
Documentation
Please update any documentation when needed in the documentation folder)
Checklist
This checklist is for your information.
- [ x] Make sure to rebase your PR against the very latest
dev. - [x ] Features/Changes should be submitted against the
dev. - [x ] Bugfixes should be submitted against the
bugfixbranch. - [x ] Give a meaningful name to your PR, as it may end up being used in the release notes.
- [x ] Your code is flake8 compliant.
- [x ] Your code is python 3.11 compliant.
- [x ] If this is a new feature and not a bug fix, you've included the proper documentation in the docs at https://github.com/DefectDojo/django-DefectDojo/tree/dev/docs as part of this PR.
- [x ] Model changes must include the necessary migrations in the dojo/db_migrations folder.
- [x ] Add applicable tests to the unit tests.
- [x ] Add the proper label to categorize your PR.
Extra information
Please clear everything below when submitting your pull request, it's here purely for your information.
Moderators: Labels currently accepted for PRs:
- Import Scans (for new scanners/importers)
- enhancement
- performance
- feature
- bugfix
- maintenance (a.k.a chores)
- dependencies
- New Migration (when the PR introduces a DB migration)
- settings_changes (when the PR introduces changes or new settings in settings.dist.py)
Contributors: Git Tips
Rebase on dev branch
If the dev branch has changed since you started working on it, please rebase your work after the current dev.
On your working branch mybranch:
git rebase dev mybranch
In case of conflict:
git mergetool
git rebase --continue
When everything's fine on your local branch, force push to your myOrigin remote:
git push myOrigin --force-with-lease
To cancel everything:
git rebase --abort
Squashing commits
git rebase -i origin/dev
- Replace
pickbyfixupon the commits you want squashed out - Replace
pickbyrewordon the first commit if you want to change the commit message - Save the file and quit your editor
Force push to your myOrigin remote:
git push myOrigin --force-with-lease
Contextual Security Analysis
As DryRun Security performs checks, we’ll summarize them here. You can always dive into the detailed results in the section below for checks.
| Status | DryRun Security Check |
|---|---|
| ✅ | Sensitive Functions Analyzer |
| ❌ | Configured Sensitive Files Check |
| ✅ | Sensitive Files Analyzer |
Chat with your AI-powered Security Buddy by typing @dryrunsecurity followed by your question into a comment.
Example: @dryrunsecurity What are common security issues with web application cookies?
Install and configure more repositories at DryRun Security
I think it can be done easily by changing those two fields as Char instead of Int.
The jira.transition_issue as shown in the code it uses the find_transitionid_by_name method to convert the transition name into the id. I did not delve if this configuration is used somewhere else in the rest of the application but if necessary it's possible to check if it's an int or not in case it's not an int use the jira.find_transitionid_by_name to retrieve the transaction id.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Closed as stale