{"id":17294640,"url":"https://github.com/mbrt/jira-template","last_synced_at":"2025-03-26T19:43:33.932Z","repository":{"id":74540894,"uuid":"90780761","full_name":"mbrt/jira-template","owner":"mbrt","description":"Command line tool for jira, templatizable","archived":false,"fork":false,"pushed_at":"2017-05-30T15:06:01.000Z","size":8,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T01:51:19.158Z","etag":null,"topics":["jira","jira-cli","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbrt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-09T18:49:18.000Z","updated_at":"2023-07-25T04:23:21.000Z","dependencies_parsed_at":"2023-02-28T09:15:42.284Z","dependency_job_id":null,"html_url":"https://github.com/mbrt/jira-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrt%2Fjira-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrt%2Fjira-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrt%2Fjira-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrt%2Fjira-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbrt","download_url":"https://codeload.github.com/mbrt/jira-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245727635,"owners_count":20662552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jira","jira-cli","python"],"created_at":"2024-10-15T11:07:14.498Z","updated_at":"2025-03-26T19:43:33.919Z","avatar_url":"https://github.com/mbrt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jira-template\nCommand line tool for jira, templatizable.\n\nThis utility has been tested with Python 3.6, but it's very possible that\nit's compatible with previous Python versions as well. The supported Jira\nversions are the ones providing the `/rest/api/2` endpoint.\n\n## Install\nClone this repository and install its dependencies:\n\n```\ngit clone https://github.com/mbrt/jira-template.git\ncd jira-template\npip install -r requirements.txt\n```\n\nI recommend creating an alias for the command, something like:\n\n```\nalias jtmp='~/jira-template/jiratemplate/cli.py'\n```\n\n## Usage\nThe command line is available with:\n\n```\njira-template/jiratemplate/cli.py\n```\n\nThe idea is pretty simple. After you configure two files: `template.json` and\n`conf.yaml`, the utility can be used to create and get tickets from Jira.\n\nWhenever you create a ticket, you have to specify the summary in the command\nline. You can edit the ticket description via the editor that is fired up\nafterwards.\n\n## Configuration\nStart from the example in `examples/conf.yaml`:\n\n```\nmkdir -m 700 -p ~/.jira-template\ncp jira-template/conf.yaml ~/.jira-template/\n```\n\nEdit it and provide the following informations:\n\n* the server address\n* the username\n* the password encoded in base64 (you can encode it by using `echo MYPWD | base64 -`)\n\nYou can leave the rest as is for the moment.\n\nAfter you've done this, try to access a ticket number, by using:\n\n```\njtmp get \u003cticket-id\u003e\n```\n\nThe result should be a json encoded object that describes the ticket.\nStarting from that you can create your own ticket template, like the one\nprovided in `jira-template/examples/template.json`. I recommend starting from\nthat example and add only the mandatory fields for your issue types in Jira:\n\n```\ncp jira-template/template.json ~/.jira-template/\n```\n\nThe rules are pretty simple:\n\n* everything that is hardcoded will be sent as is to Jira;\n* every value starting with a dollar sign is a variable;\n* variables can be templated by a value inside `conf.yaml`; if no matches are\n  found, the key-value pair will be left out from the resulting json. This\n  can be used for optional fields.\n\nMore details on the templating rules are provided in the next section.\n\n## Templating\nA template is simply a section in `conf.yaml` with a certain id:\n\n```\nsections:\n  - id: kube-bug-80\n    issue_type: Bug\n    versions:\n      - id: \"11314\"\n```\n\nYou can add as many sections as you want. These will be selected by the create\ncommand with the `-s \u003csection-name\u003e` flag.\n\nFor example:\n\n```\njtmp create --dry-run -s kube-bug-80 \"this is an ugly bug\"\n```\n\nwill use the section with id `kube-bug-80` to replace the variables in the\n`template.json` and fire a request to Jira to create that ticket. Note that the\n`--dry-run` flag has been added to print the request without actually creating\nthe ticket.\n\nSince the configuration file is a yaml, you can leverage its pretty cool\nreference mechanism to avoid repeting yourself. For example, with this\nreference:\n\n```\ntemplates:\n  me: \u0026ME my-username\n```\n\nyou can avoid repeting your username over and over in all the sections, and\nstart using the `\u0026ME` reference instead:\n\n```\nsections:\n  - id: kube-bug-80\n    assignee: *ME\n```\n\nThis is even more powerful, since you can template tickets hierarchically, like\nthis:\n\n```\ntemplates:\n  me: \u0026ME REPLACEME\n  dk-account: \u0026KUBE-ACCOUNT 16\n  version-80: \u0026VER-80 \"11314\"\n  version-90: \u0026VER-90 \"11350\"\n  kube: \u0026KUBE-ISSUE\n    account_id: *KUBE-ACCOUNT\n    labels:\n      - kubernetes\n    assignee: *ME\n```\n\nAnd then provide various sections that reuse the common `KUBE-ISSUE` template:\n\n```\nsections:\n  - \u003c\u003c: *KUBE-ISSUE\n    id: kube-bug-80\n    issue_type: Bug\n    versions:\n      - id: *VER-80\n  - \u003c\u003c: *KUBE-ISSUE\n    id: kube-bug-90\n    issue_type: Bug\n    versions:\n      - id: *VER-90\n```\n\nAfter the references are resolved, the result is:\n\n```\nsections:\n  - account_id: 16\n    labels:\n      - kubernetes\n    assignee: my-username\n    id: kube-bug-80\n    issue_type: Bug\n    versions:\n      - id: 11314\n  - account_id: 16\n    labels:\n      - kubernetes\n    assignee: my-username\n    id: kube-bug-90\n    issue_type: Bug\n    versions:\n      - id: 11350\n```\n\nA very powerful mechanism.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrt%2Fjira-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbrt%2Fjira-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrt%2Fjira-template/lists"}