Skip to main content

CircleCI

Watson-Jira (next)

Upload Watson time logs to Jira from the CLI! Selects Watson time logs based on the configurable mapping rules, formats those logs to Tempo format, and uploads to the appropriate Jira issues. Will not double-write logs, and makes no local edits.

This fork from original project. Unfortunately original author doesn't reply. Please use this repository to open issues or pull requests.

Install

$ pip install watson-jira-next

Config

Config is stored in $XDG_CONFIG_HOME/.config/watson-jira/config.yaml.

JIRA

jira section should contain JIRA base URL and one of the authentication methods.

server: <<JIRA base URL>>

Auth: API token

See Atlassian docs. Add the following to the config file:

email: <<email>>
apiToken: <<API token>>

Auth: Personal Access Token

See Atlassian docs. Add the following to the config file:

personalAccessToken: <<PAT>>
  1. login to JIRA in the browser
  2. open Network tab in the developer tools
  3. copy the cookie from the request header
  4. add the following to the config file:
cookie: <<cookie>>

Mappings

mappings section contains list of mapping rules.

Mapping rule has name and type. For each Watson log, Watson-Jira tries to find the name in the tags. If found, then the JIRA issue number is resolved according to the type definition.

Mapping precedence is of the following order:

Single issue

name: vacation
type: single_issue
issue: JIRA-1

This type always returns the one specified JIRA issue number.

Watson example: watson add -f 10:00 -t 18:00 none +vacation

Issue per project

name: maintenance
type: issue_per_project
projects:
  project1: JIRA-2
  project2: JIRA-3

This type returns JIRA issue number based on the project name.

Watson example: watson add -f 10:00 -t 11:00 project2 +maintenance +dependencies-upgrade

Issue specified in the tag

name: sprint
type: issue_specified_in_tag

This type resolves the JIRA issue number from the first tag which matches the issue number regex.

Example: watson add -f 10:00 -t 11:00 project1 +sprint +JIRA-123 +code

Issue specified in the project name

For any Watson log, which doesn't match any of the mappings, the JIRA issue number will be tried to be resolved from the project name.

Watson example: watson add -f 10:00 -t 11:00 JIRA-123 +investigation

Full config example

jira:
  server: http://localhost:8080
  cookie: atlassian.xsrf.token=BEHZ-5GE9-RXNS-7J78_bfa98881ae96448d36fdaa94f2b3ac6b8f205885_lout; JSESSIONID=51D8547A4C356A8355F8FDAF7CC97D51
mappings:
  - name: sprint
    type: issue_specified_in_tag
  - name: vacation
    type: single_issue
    issue: HR-123
  - name: maintenance
    type: issue_per_project
    projects:
      project1: JIRA-1
      project2: JIRA-2

Usage

Show Jira-specific logs from today

$ watson-jira logs --jira-only --tempo-format

Show existing work logs for a Jira issue

$ watson-jira logs tempo --issue JIRA-1

Upload logs from today interactively

$ watson-jira sync --from 3 --interactive

Upload logs from the last 3 days

$ watson-jira sync --from 3

Help

$ watson-jira --help

Will install TD-Watson https://github.com/TailorDev/Watson as one of its dependencies, not surprisingly.

Metadata

Release files for watson-jira-next 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for watson-jira-next 0.3.3
File Size Uploaded Provenance Actions
watson-jira-next-0.3.3.tar.gz 10.3 kB Without provenance Details for watson-jira-next-0.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for watson-jira-next 0.3.3
File Interpreter ABI Platform Actions
watson_jira_next-0.3.3-py3-none-any.whl Python 3 none any Details for watson_jira_next-0.3.3-py3-none-any.whl

Total release size: 20.8 kB

Release files / watson-jira-next-0.3.3.tar.gz

Download URL watson-jira-next-0.3.3.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
06a3c7c076d04fe161839aaab0e6f177f1120fdd2262c8b0ad115da7c943f371
BLAKE2b-256 checksum
How to use checksums
0686d697ece4f43fe0d7feb1b3cc2457b40ad66bc6d0fc843d8d5730aed420fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.9.13 Linux/5.10.118

Release files / watson_jira_next-0.3.3-py3-none-any.whl

Download URL watson_jira_next-0.3.3-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c913a8c720b0ec17edfcec26afc612909e53740c22a9c69f586120356eaaf1d4
BLAKE2b-256 checksum
How to use checksums
9c403ad3257ae6ed35ec7f6f03ae37bcbe194b4908c3cfcce7e9f8b5c758cacf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.9.13 Linux/5.10.118

Security for watson-jira-next 0.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page