You need to have the following commands installed:
- You need a YouTrack API Token (how to get one)
- Setup an environment variable called
YT_API_TOKENwith your YouTrack API Token (ex:perm:dAIdindN=.9AnQ) - Setup an environment variable called
YT_API_URLpointing to your YouTrack API URL (ex:https://you.track.com/youtrack/api) - Setup an environment variable called
YT_API_USERNAME, this is your YouTrack user login name
-
A
projectis compose of a name, and id and a short name- ex: Project named
Youtrack Globalsshorted toYTG, with id0-1
- ex: Project named
-
An
issue name, also calledid readable, is a jointure of its project's short name and an ID- ex: First issue from project
Youtrack Globalswould beYTG-1
- ex: First issue from project
-
Issue types must match their projects types. You can use the
-T <Project>option to list the available types for a project.
The script can be used with a formatted file, or by feeding the command line.
Whichever method you chose, the format the must follow its respective guideline:
- Line:
<Issue Name> <Time Spent> <Date> [Type] [Text]- Issue Name
- Required
- Time Spent
- Required
- Format:
:h:m
- Date
- Required
- Format:
yyyy-mm-dd
- Type
- Optional
- Text
- Optional
- Issue Name
-
Line:
#setdate <Date>To set the date of the following lines- Date format:
yyyy-mm-dd
- Date format:
-
Line:
<Issue Name> <Time Spent> [Type] [Text]- Issue Name
- Required
- Time Spent
- Required
- Format:
:h:m
- Type
- Optional
- Text
- Optional
- Issue Name
To log spent time of ...
- 5 hours and 30 minutes
- the 01/01/2020
- on the issue YouTrack Globals
YTG-1- (optional) with type
Daily Meeting - (optional) with the comments
New script meeting !
- (optional) with type
Bellow are some exemples varying the optional parameters
| Desired work log | Command to run |
|---|---|
| Only the date and duration | ./youtrack.sh YTG-1 5h30m 2020-01-01 |
| With type | ./youtrack.sh YTG-1 5h30m 2020-01-01 "Daily Meeting" |
| Without type but comments Safe method |
./youtrack.sh YTG-1 5h30m 2020-01-01 "" "New script meeting !" |
| Without type but comments Start of the comments might be interpreted as Type |
./youtrack.sh YTG-1 5h30m 2020-01-01 "New script meeting !" |
| With type and comments | ./youtrack.sh YTG-1 5h30m 2020-01-01 "Daily Meeting" "New script meeting !" |
- The command line to run for the file is pretty straight forward
./youtrack.sh /path/to/file - The
#setdate <Date>line is not impact by the optional parameters
The file would be composed of date setters follow by work-load for that date
#setdate 2020-01-01 with one of the line bellow
| Desired work log | File line format |
|---|---|
| Only the date and duration | YTG-1 5h30m |
| With type | YTG-1 5h30m "Daily Meeting" |
| Without type but comments Safe method |
YTG-1 5h30m "" "New script meeting !" |
| Without type but comments Start of the comments might be interpreted as Type |
YTG-1 5h30m "New script meeting !" |
| With type and comments | YTG-1 5h30m "Daily Meeting" "New script meeting !" |