pbauerochse / youtrack-worklog-viewer

A tool to keep track of the work hours you spent on issues in the YouTrack issue management system
MIT License
39 stars 10 forks source link

Support for specifying work type when adding work items #40

Closed sabieber closed 3 years ago

sabieber commented 4 years ago

Hello,

it would be really nice to have support for selecting different work types when creating a work item. These could be loaded when entering the dialog via the following API endpoint: YouTrack documentation

I had a quick look at the source code and began to integrate the desired functionality but hat to change quite a bit to be able to pass the project id / shortname or the fetched list of work types to the "create work item" dialog so I am not really sure what way of integrating it you would prefer.

So it would be brilliant if you could have a look into integrating it as it would improve the ability of time tracking with your awesome tool!

PS: if you hint me in the direction how you would like the feature/request to be integrated into your architecture I am more than happy to create a PR myself :)

pbauerochse commented 4 years ago

Hi @sabieber ,

this is in fact missing from the current version because it was quite difficult to implement. As you already found out you first have to pass the project name to YouTrack in order to get the valid work types. I actually am not too happy with the text input field for the issue id in the add work item dialog, as changing it would invalidate the work type combobox.

I haven't looked into it too much yet. But from the top of my head I see the following necessary changes:

If you already spent some time trying to implement this feature feel free to submit a pull request. If you don't find the time to do so, rest assured that this is a feature, that will be implemented by me soon anyways.

Cheers

Patrick

sabieber commented 4 years ago

Hi @pbauerochse ,

thanks for your fast response and input into this feature request. The list of changes seems good and I guess I am halfway done with this but did not remove any of the existing functionality yet (editable issue field). Having the issue number as a label sounds like the proper way to go.

I think I can work on it a little bit more next weekend and will see if I make good enough progress to submit a pull request.

A more specific question regarding the implementation: Would you mind if I included the issue id/shortName in the MinimalIssue class? This would mean some changes to the internal workings but would help immensely with fetching the work types in the popup controller. Or do you have another suggestion how to solve this?

Grretings, Sascha

pbauerochse commented 4 years ago

A more specific question regarding the implementation: Would you mind if I included the issue id/shortName in the MinimalIssue class? This would mean some changes to the internal workings but would help immensely with fetching the work types in the popup controller. Or do you have another suggestion how to solve this?

Not at all. Feel free to add those fields, as long as they are primitive types and not any complex objects.

If you need more support just let me know. Nice to see, that there's more people using the worklog viewer apart from my work colleagues ;)

pbauerochse commented 3 years ago

Finally implemented in v2.7.0