dapritchard / jiraworklog Goto Github PK
View Code? Open in Web Editor NEWCommand-line application to synchronize local worklog records with a Jira server
Command-line application to synchronize local worklog records with a Jira server
Some examples of things to test for:
Use the same representation as for the regular entries lists but add a level of depth after issueId level with added
, updated
, and removed
keys.
Suppose we have the following collection of work time entries
entry 1
entry 2
that we provide as an input to our routines which has the effect of uploading the entries to Jira.
Then later we add another entry so that the entries look like this:
entry 1
entry 2
entry 3
If we want to submit this collection of entries to our routines then we want this to have the effect of uploading the entry 3
to Jira, but not entry 1
nor entry 2
.
We have the following actions that can occur.
Note that for our routines to be able to distinguish an update from a removal and addition, a given work log entry will have to have some kind of identifier. Some time clock applications will not provide us with such information, so we will need to think about whether we will want to have different behavior based on whether or not we have that information (in other words, even if we did have that information we could treat modifications the same as a removal and addition).
Let's call for now the entries that are already logged in to Jira the checked-in entries.
If we add/remove/update an entry on the remote then ideally we would have a mechanism to update the local entry. However, most time clock applications will not have an programmatic way to make such an update, and I think we should support such applications. If we accept this as a fundamental limitation of our application, then we have the following options. Note that work log entries have a unique identifier so we always do have the ability to unambiguously identify what add/remove/update has occurred.
Open questions:
The routines will be presented as a Python package that can be downloaded by pip
. The installation will include a an executable script that will serve as a command-line application. Thus the user installation process will roughly be:
pip
bin
directory is on $PATH
.The main information that the application needs as inputs are the following.
--file
command-line argument.~/.config/jira-worklog/jira-worklog-state
. Or maybe we could check the current working directory for a particular file name. We should probably also take command line arguments specifying non-default locations to read from and write to.Given these considerations, a typical invocation might look something like the following (and where the checked-in worklog state and parsing information data is stored in some standard location).
jira-upload-worklog worklog-entries.csv
The fully specified version might look something like the following.
jira-upload-worklog --checked-in-entries=path/to/file --parse-config=path/to/other-file worklog-entries.csv
Push worklogs:
Push worklogs:
See pytz: The Fastest Footgun in the West. At the top of the datetime documentation there's also a link to zoneinfo, which itself has a link to tzdata.
To experiment with this package:
jira
package is installed and on your search path.from jira import JIRA
user = '[email protected]' # your email address
apikey = 'XXXXXXXX' # your API token
server = 'https://my.host.net' # the URL up to the host name
jira = JIRA(server, basic_auth=(user,apikey) )
If you are able to authenticate then you can do something like the following.
from pprint import pprint # only needed for interactive noodling around
# Load the following routine from `fetch_worklogs.py`
out = fetch_worklogs_remotedata(jira, ['P0053-4'])
pprint(out)
# This is what the raw data looks like
issue_p0053_04 = jira.issue('P0053-4')
worklogs_list = jira.worklogs(issue_p0053_04)
pprint(vars(worklogs_list[0]))
Consider the following example CSV.
task,start,end,tags
Review sample size calculations document before 2021-01-05 meeting,2021-01-04 14:52,2021-01-04 16:53,P0053_07_rpp
Update effect size (power) calculations,2021-01-07 13:01,2021-01-07 14:54,P0053_07_rpp
Update effect size (power) calculations,2021-01-07 09:59,2021-01-07 11:45,P0053_07_rpp
Review effect size calculations Slack thread,2021-01-08 09:00,2021-01-08 09:30,P0053_07_rpp
Channel Slack conversation,2021-01-12 09:00,2021-01-12 09:33,P0053_07_rpp
Effort estimate for additional sensitivity analyses,2021-01-11 22:09,2021-01-11 22:55,P0053_04_pre_contract_work
Prepare Bayesian method proposal,2021-01-14 13:10,2021-01-14 13:30,P0053_12_meetings
Add project Git configuration file to specify 'pull as a rebase',2021-02-15 16:41,2021-02-15 17:15,P0053_07_rpp
Create a list of covariates to QC,2021-02-15 12:46,2021-02-15 13:00,P0053_14_create_cohort
Suppose this output is generated from some time clock application. We process the data upload the entries to Jira using the functionality provided by this library. Then some time passes and we generate some new work time entries, and we export the data again from our application. This new data may contain all of the original entries plus some new entries. If we provide the entirety of the newly exported data as the input to the library routines, the routines should be smart enough to upload only the new work time entries to Jira.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.