# Jira Asset Manager
[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/) ![GitHub release (release name instead of tag name)](https://img.shields.io/github/v/release/hatamiarash7/jira-asset-manager?sort=date) ![GitHub](https://img.shields.io/github/license/hatamiarash7/jira-asset-manager)
Manage Jira assets in your code or CLI.
- [Jira Asset Manager](#jira-asset-manager)
- [Requirements](#requirements)
- [Install](#install)
- [How-to](#how-to)
- [CLI](#cli)
- [Create assets](#create-assets)
- [Update assets](#update-assets)
- [Add comment](#add-comment)
- [Package](#package)
- [Get asset](#get-asset)
- [Create asset](#create-asset)
- [Update asset](#update-asset)
- [Add comment](#add-comment-1)
- [Support 💛](#support-)
- [Contributing 🤝](#contributing-)
## Requirements
- Python 3.8+
## Install
```bash
pip install jira-amt
```
## How-to
You need to add these environment variables to use the CLI:
| Variable | Description |
| ----------- | -------------------------------------------------- |
| JIRA_SERVER | Jira server address like `https://jira.domain.com` |
| JIRA_PAT | Your personal access token |
After setting these variables, you can configure the CLI:
```bash
jira-amt init
```
This command will get everything from your Jira server and save them to `~/.jira` directory for later use. With this data, you don't need to know/use ID of each asset/attribute.
## CLI
There is some commands to manage assets. Check them using the `--help` flag.
### Create assets
The asset creation in CLI is not make sense, because you need to enter all attributes in command line. But you can use it in your code.
### Update assets
You can update asset's attribute using it's name. The script will get the asset id from the name automatically.
```bash
jira-amt attr <schema> <object> <asset name> <attr name> <attr value>
jira-amt attr "ITSM" "Servers" "Server-1" "IP" "1.2.3.4"
```
### Add comment
You can add comment to an asset using it's name. The script will get the asset id from the name automatically.
```bash
jira-amt comment <schema> <object> <asset name> <comment>
jira-amt comment "ITSM" "Servers" "Server-1" "This is a comment"
```
---
## Package
You can use this package in your code to manage Jira assets.
```python
from jira_amt.jira import JiraAssetHandler
jira = JiraAssetHandler(
server="https://jira.domain.com",
pat="ABCD1234"
)
```
### Get asset
```python
asset = jira.get_asset("schema", "object", "asset's name")
print(asset.text)
```
### Create asset
```python
input = {
"Name": "Server-1",
"Status": "Running",
"Environment": "Production",
"OS": "Debian",
"IP": "1.2.3.4"
}
asset = jira.create_asset("schema", "object", input)
```
### Update asset
```python
asset = jira.get_asset("schema", "object", "asset's name")
print(asset.text)
```
### Add comment
```python
result = jira.add_comment("schema", "object", "asset's name", "comment")
print(result.status_code)
```
## Support 💛
[![Donate with Bitcoin](https://img.shields.io/badge/Bitcoin-bc1qmmh6vt366yzjt3grjxjjqynrrxs3frun8gnxrz-orange)](https://donatebadges.ir/donate/Bitcoin/bc1qmmh6vt366yzjt3grjxjjqynrrxs3frun8gnxrz) [![Donate with Ethereum](https://img.shields.io/badge/Ethereum-0x0831bD72Ea8904B38Be9D6185Da2f930d6078094-blueviolet)](https://donatebadges.ir/donate/Ethereum/0x0831bD72Ea8904B38Be9D6185Da2f930d6078094)
<div><a href="https://payping.ir/@hatamiarash7"><img src="https://cdn.payping.ir/statics/Payping-logo/Trust/blue.svg" height="128" width="128"></a></div>
## Contributing 🤝
Don't be shy and reach out to us if you want to contribute 😉
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
Raw data
{
"_id": null,
"home_page": "https://arash-hatami.ir",
"name": "jira-amt",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "jira,asset",
"author": "Arash Hatami",
"author_email": "hatamiarash7@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/24/03/cc09b6c58f402a34c5d8e9fdd3a8df9544f7c8b88bdb70a67863646521d3/jira_amt-1.3.1.tar.gz",
"platform": null,
"description": "# Jira Asset Manager\n\n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/) ![GitHub release (release name instead of tag name)](https://img.shields.io/github/v/release/hatamiarash7/jira-asset-manager?sort=date) ![GitHub](https://img.shields.io/github/license/hatamiarash7/jira-asset-manager)\n\nManage Jira assets in your code or CLI.\n\n- [Jira Asset Manager](#jira-asset-manager)\n - [Requirements](#requirements)\n - [Install](#install)\n - [How-to](#how-to)\n - [CLI](#cli)\n - [Create assets](#create-assets)\n - [Update assets](#update-assets)\n - [Add comment](#add-comment)\n - [Package](#package)\n - [Get asset](#get-asset)\n - [Create asset](#create-asset)\n - [Update asset](#update-asset)\n - [Add comment](#add-comment-1)\n - [Support \ud83d\udc9b](#support-)\n - [Contributing \ud83e\udd1d](#contributing-)\n\n## Requirements\n\n- Python 3.8+\n\n## Install\n\n```bash\npip install jira-amt\n```\n\n## How-to\n\nYou need to add these environment variables to use the CLI:\n\n| Variable | Description |\n| ----------- | -------------------------------------------------- |\n| JIRA_SERVER | Jira server address like `https://jira.domain.com` |\n| JIRA_PAT | Your personal access token |\n\nAfter setting these variables, you can configure the CLI:\n\n```bash\njira-amt init\n```\n\nThis command will get everything from your Jira server and save them to `~/.jira` directory for later use. With this data, you don't need to know/use ID of each asset/attribute.\n\n## CLI\n\nThere is some commands to manage assets. Check them using the `--help` flag.\n\n### Create assets\n\nThe asset creation in CLI is not make sense, because you need to enter all attributes in command line. But you can use it in your code.\n\n### Update assets\n\nYou can update asset's attribute using it's name. The script will get the asset id from the name automatically.\n\n```bash\njira-amt attr <schema> <object> <asset name> <attr name> <attr value>\njira-amt attr \"ITSM\" \"Servers\" \"Server-1\" \"IP\" \"1.2.3.4\"\n```\n\n### Add comment\n\nYou can add comment to an asset using it's name. The script will get the asset id from the name automatically.\n\n```bash\njira-amt comment <schema> <object> <asset name> <comment>\njira-amt comment \"ITSM\" \"Servers\" \"Server-1\" \"This is a comment\"\n```\n\n---\n\n## Package\n\nYou can use this package in your code to manage Jira assets.\n\n```python\nfrom jira_amt.jira import JiraAssetHandler\n\njira = JiraAssetHandler(\n server=\"https://jira.domain.com\",\n pat=\"ABCD1234\"\n)\n```\n\n### Get asset\n\n```python\nasset = jira.get_asset(\"schema\", \"object\", \"asset's name\")\n\nprint(asset.text)\n```\n\n### Create asset\n\n```python\ninput = {\n \"Name\": \"Server-1\",\n \"Status\": \"Running\",\n \"Environment\": \"Production\",\n \"OS\": \"Debian\",\n \"IP\": \"1.2.3.4\"\n}\n\nasset = jira.create_asset(\"schema\", \"object\", input)\n```\n\n### Update asset\n\n```python\nasset = jira.get_asset(\"schema\", \"object\", \"asset's name\")\n\nprint(asset.text)\n```\n\n### Add comment\n\n```python\nresult = jira.add_comment(\"schema\", \"object\", \"asset's name\", \"comment\")\n\nprint(result.status_code)\n```\n\n## Support \ud83d\udc9b\n\n[![Donate with Bitcoin](https://img.shields.io/badge/Bitcoin-bc1qmmh6vt366yzjt3grjxjjqynrrxs3frun8gnxrz-orange)](https://donatebadges.ir/donate/Bitcoin/bc1qmmh6vt366yzjt3grjxjjqynrrxs3frun8gnxrz) [![Donate with Ethereum](https://img.shields.io/badge/Ethereum-0x0831bD72Ea8904B38Be9D6185Da2f930d6078094-blueviolet)](https://donatebadges.ir/donate/Ethereum/0x0831bD72Ea8904B38Be9D6185Da2f930d6078094)\n\n<div><a href=\"https://payping.ir/@hatamiarash7\"><img src=\"https://cdn.payping.ir/statics/Payping-logo/Trust/blue.svg\" height=\"128\" width=\"128\"></a></div>\n\n## Contributing \ud83e\udd1d\n\nDon't be shy and reach out to us if you want to contribute \ud83d\ude09\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Manage Jira assets.",
"version": "1.3.1",
"project_urls": {
"Bug Tracker": "https://github.com/hatamiarash7/jira-asset-manager/issues",
"Homepage": "https://arash-hatami.ir",
"Repository": "https://github.com/hatamiarash7/jira-asset-manager"
},
"split_keywords": [
"jira",
"asset"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "02dc1a02ae6bbd4fd0422f301ecdede736f123d7f95a44f0b330455a1ae28c21",
"md5": "2140a792ea1ec76887350430369896b8",
"sha256": "2c87337f3b53969a8a9a93024d01d0450a4c99b60371f849338abc00c9ba9b73"
},
"downloads": -1,
"filename": "jira_amt-1.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2140a792ea1ec76887350430369896b8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 7950,
"upload_time": "2023-08-07T09:37:05",
"upload_time_iso_8601": "2023-08-07T09:37:05.763322Z",
"url": "https://files.pythonhosted.org/packages/02/dc/1a02ae6bbd4fd0422f301ecdede736f123d7f95a44f0b330455a1ae28c21/jira_amt-1.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2403cc09b6c58f402a34c5d8e9fdd3a8df9544f7c8b88bdb70a67863646521d3",
"md5": "c7628b329d89c6f3533c8a06ffd9a8ef",
"sha256": "408d676cad2147c5e317cabb555057323b5a4ee990be4bcfa9f5e6bed04a82ba"
},
"downloads": -1,
"filename": "jira_amt-1.3.1.tar.gz",
"has_sig": false,
"md5_digest": "c7628b329d89c6f3533c8a06ffd9a8ef",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 6399,
"upload_time": "2023-08-07T09:37:07",
"upload_time_iso_8601": "2023-08-07T09:37:07.111040Z",
"url": "https://files.pythonhosted.org/packages/24/03/cc09b6c58f402a34c5d8e9fdd3a8df9544f7c8b88bdb70a67863646521d3/jira_amt-1.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-07 09:37:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hatamiarash7",
"github_project": "jira-asset-manager",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "jira-amt"
}