devopshq / youtrack

YouTrack Python 3 Client Library
https://devopshq.github.io/youtrack/
MIT License
27 stars 14 forks source link

closing issues? #24

Open seansan opened 4 years ago

seansan commented 4 years ago

when trying to close an issue there is no method like create? or do we use edit?

an example would be cool

SAnCherepan commented 4 years ago

YouTrack issue is considered closed when it's State is resolved. In a single project multiple states can be marked as resolved (Done, Duplicate, Canceled and so on) and so there is no way to close an issue automatically.

Let's say your final state is Done and your project does not have a state-machine rule in your workflow (i.e. transitions from any state to any state are allowed). Then the operation would be as simple as issue["State"] = "Done" or connection.execute_command(issue_id="<issue_id>", command='State Done').

Now if your workflow only allows to go to Done only from In progress and your target issue is New, then you would have to execute multiple operations and transition through your workflow, same as you would in web UI.

Let me know if you have any further issues.