Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JIRA] project can use different workflows, and transition ID do not scale #3821

Open
madchap opened this issue Feb 8, 2021 · 14 comments
Open

Comments

@madchap
Copy link
Contributor

madchap commented Feb 8, 2021

Is your feature request related to a problem? Please describe
Projects can use different workflows, or they can change unexpectedly.

Whenever this happens, you would notice things such as

JiraError HTTP 400 url: https://xxxx.atlassian.net/rest/api/2/issue/xxx-7013/transitions
    text: Transition id '11' is not valid for this issue.
    
    response headers = {'Server': 'AtlassianProxy/1.15.8.1', [blablabla]}
    response text = {"errorMessages":["Transition id '11' is not valid for this issue."],"errors":{}}

In this case, it related to a transition moving to "Open".

Describe the solution you'd like
A way that's not dependent on transition ID, or a more agnostic way. Not sure what.

@valentijnscholten
Copy link
Member

This is why I am hesitant of the trying to implement a two-way sync between JIRA and Dojo. Lots of things only work if you have a simple and close to default workflow.

Thoughts:

  • You can have multiple jira instances in dojo for the same real life jira instance. You can vary transition ids in this way
  • We could try to see what's in the jira meta data we get to see if we can map transition names to ids. i.e. configure the name of the transtion in Dojo. Or even the target state and it tries to transition the issue into that state.

Syncing with JIRA could be a open source project of its own ;-)

@madchap
Copy link
Contributor Author

madchap commented Feb 8, 2021

Yes - that's what I did, I created a new JIRA instance with different workflow transition IDs.

@madchap
Copy link
Contributor Author

madchap commented Feb 8, 2021

Syncing with JIRA could be a open source project of its own ;-)

The mother of all time sinks.

@stale
Copy link

stale bot commented Jun 11, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 11, 2021
@stale stale bot closed this as completed Jul 21, 2021
@devsecopsale
Copy link
Contributor

devsecopsale commented Feb 9, 2024

this could be solved in a simple way: since transitions IDs could be different and many (transition IDs) could conduct to closed status depending on its source status, using transition name instead of its id will solve the problem. It will even work when using different workflows. Only the transition name has to be consistent in each workflow that is synced with Defectdojo.

example:
we get the transitions fields and search for a name, then get the id. So, transition name can be added to Jira settings and used alternatively between transition id (only one should be chosen). Then on the jira code, a function is called that gets the transition id for every time a ticket has to be updated.
curl https://jira_server/jira/rest/api/latest/issue/TICKET-1234/transitions?expand=transition.fields | jq '.transitions[] | "(.id),(.name)"'

@devsecopsale
Copy link
Contributor

devsecopsale commented Feb 9, 2024

@valentijnscholten , is it possible to re-open this one? I could add the code for this one if it gets approved. Thanks

@valentijnscholten
Copy link
Member

We need an admin to reopen @mtesauro

@mtesauro
Copy link
Contributor

mtesauro commented Feb 9, 2024

@devsecopsale If you want to put in a PR to make the change you are proposing, I don't have issue with that.

@mtesauro mtesauro reopened this Feb 9, 2024
@stale stale bot removed the stale label Feb 9, 2024
@devsecopsale
Copy link
Contributor

Thank you. I'm currently testing it. I'll touch base once I have the PR.

@devsecopsale
Copy link
Contributor

@mtesauro , PR #9543 was submitted. This will fix this issue.

@devsecopsale
Copy link
Contributor

I see 2 fails: 1 (security) I believe is because I'm changing settings.dist.py: I only added an env variable. For the other error (unit test), I can't see what exactly is failing. Couldn't find any error message

@valentijnscholten
Copy link
Member

I believe the close transition name should be a property of the jira_instance, not an environment variable. Different instances can have different closing transition names.

@mtesauro
Copy link
Contributor

@devsecopsale

I see 2 fails: 1 (security) I believe is because I'm changing settings.dist.py: I only added an env variable. For the other error (unit test), I can't see what exactly is failing. Couldn't find any error message

We're currently testing out Dryrun Security's tool in a GHA so don't worry about the failure of "Configured Sensitive Files Analyzer" as we're still working with Dryrun Security on those tests

I believe the close transition name should be a property of the jira_instance, not an environment variable. Different instances can have different closing transition names.

I agree with @valentijnscholten here - since DefectDojo supports multiple Jira instances which don't necessarily have to be configured similarly (e.g. company acquires another company and inherits a Jira instance) so configuring that globally is likely to cause issues.

@devsecopsale
Copy link
Contributor

I see your point. It will take me some time to do that. I'll try to have it done during March.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants