{ "info": { "author": "Miguel Ferrer", "author_email": "ingferrermiguel@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# jira-cloud-python\n\njira-cloud-python is an API wrapper for Jira Software Cloud written in Python\n\n## Installing\n```\npip install jira-cloud-python\n```\n\n## Usage\n\n#### Client instantiation\n```\nfrom jiracloud.client import Client\n\nclient = Client('CLIENT_ID', 'CLIENT_SECRET') # Host must have trailing slash\n```\n\n### OAuth 2.0 (3LO)\n\nFor more information: https://developer.atlassian.com/cloud/jira/platform/oauth-2-authorization-code-grants-3lo-for-apps/\n\n#### Direct the user to the authorization URL to get an authorization code\n\nA refresh token can be returned with the access token in your initial authorization flow. \nTo do this, add the offline_access scope to the scope parameter of the authorization URL.\n\n```\nscope_list = ['read:jira-user', 'read:jira-work', 'write:jira-work', 'offline_access']\nurl = client.authorization_url('REDIRECT_URI', scope_list, 'STATE')\n```\n\n#### Exchange authorization code for access token\n```\nresponse = client.exchange_code('REDIRECT_URI', 'CODE')\n```\n\n#### Set access token in the library\n```\nclient.set_access_token('ACCESS_TOKEN')\n```\n\n#### Get the cloudid for your site\n```\nresponse = client.get_resource_list()\n```\n\n#### Set cloudid in the library\n```\nclient.set_cloud_id('CLOUD_ID')\n```\n\n#### Refresh token\n```\nresponse = client.refresh_token('REFRESH_TOKEN')\n```\n\n### Issues\n\n#### Get issue\n```\nresponse = client.issues.get_issue('ISSUE_ID')\n```\n\n#### Create issue\n```\ndata = {\n \"update\": {},\n \"fields\": {\n \"summary\": \"something's wrong\",\n \"issuetype\": {\n \"id\": \"10000\"\n },\n \"components\": [\n {\n \"id\": \"10000\"\n }\n ],\n \"customfield_20000\": \"06/Jul/19 3:25 PM\",\n \"customfield_40000\": {\n \"type\": \"doc\",\n \"version\": 1,\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"text\": \"this is a text field\",\n \"type\": \"text\"\n }\n ]\n }\n ]\n },\n \"customfield_70000\": [\n \"jira-administrators\",\n \"jira-software-users\"\n ],\n \"project\": {\n \"id\": \"10000\"\n },\n \"description\": {\n \"type\": \"doc\",\n \"version\": 1,\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"text\": \"description\",\n \"type\": \"text\"\n }\n ]\n }\n ]\n },\n \"reporter\": {\n \"id\": \"99:e2a16dd9-2ffb-4a4b-a9bd-bd1145a020ee\"\n },\n \"fixVersions\": [\n {\n \"id\": \"10001\"\n }\n ],\n \"customfield_10000\": \"09/Jun/19\",\n \"priority\": {\n \"id\": \"20000\"\n },\n \"labels\": [\n \"bugfix\",\n \"blitz_test\"\n ],\n \"timetracking\": {\n \"remainingEstimate\": \"5\",\n \"originalEstimate\": \"10\"\n },\n \"customfield_30000\": [\n \"10000\",\n \"10002\"\n ],\n \"customfield_80000\": {\n \"value\": \"red\"\n },\n \"security\": {\n \"id\": \"10000\"\n },\n \"environment\": {\n \"type\": \"doc\",\n \"version\": 1,\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"text\": \"environment\",\n \"type\": \"text\"\n }\n ]\n }\n ]\n },\n \"versions\": [\n {\n \"id\": \"10000\"\n }\n ],\n \"duedate\": \"2019-05-11T00:00:00.000Z\",\n \"customfield_60000\": \"jira-software-users\",\n \"customfield_50000\": {\n \"type\": \"doc\",\n \"version\": 1,\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"text\": \"this is a text area. big text.\",\n \"type\": \"text\"\n }\n ]\n }\n ]\n },\n \"assignee\": {\n \"id\": \"e5:e1a16c14-1fe0-1c93-a2b1-ac4493ace0f1\"\n }\n }\n}\nresponse = client.issues.create_issue(data)\n```\n\n#### Delete issue\n```\nresponse = client.issues.delete_issue('ISSUE_ID')\n```\n\n#### Get create issue metadata\n```\nresponse = client.issues.get_create_issue_metadata()\n```\n\n#### Search for issues using JQL\n```\ndata = {\n \"expand\": [\n \"names\",\n \"schema\",\n \"operations\"\n ],\n \"jql\": \"project = HSP\",\n \"maxResults\": 15,\n \"fieldsByKeys\": false,\n \"fields\": [\n \"summary\",\n \"status\",\n \"assignee\"\n ],\n \"startAt\": 0\n}\nresponse = client.issues.search_for_issues_using_jql(data)\n```\n\n### Permissions\n\n#### Get my permissions\n```\nresponse = client.permissions.get_my_permissions()\n```\n\n#### Projects\n```\nresponse = client.projects.get_projects_paginated()\n```\n\n#### Users\n```\nresponse = client.users.find_users_assignable_to_issues()\n```\n\n### Webhooks\nCurrently, webhooks are not available for OAuth 2.0 apps, for more information: https://ecosystem.atlassian.net/browse/ACJIRA-1632\n\n\n## Contributing\nWe are always grateful for any kind of contribution including but not limited to bug reports, code enhancements, bug fixes, and even functionality suggestions.\n#### You can report any bug you find or suggest new functionality with a new [issue](https://github.com/ingmferrer/jira-cloud-python/issues).\n#### If you want to add yourself some functionality to the wrapper:\n1. Fork it ( https://github.com/ingmferrer/jira-cloud-python )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Adds my new feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ingmferrer/jira-cloud-python", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "jira-cloud-python", "package_url": "https://pypi.org/project/jira-cloud-python/", "platform": "", "project_url": "https://pypi.org/project/jira-cloud-python/", "project_urls": { "Homepage": "https://github.com/ingmferrer/jira-cloud-python" }, "release_url": "https://pypi.org/project/jira-cloud-python/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "API wrapper for Jira Cloud written in Python", "version": "1.0.0" }, "last_serial": 5737621, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "d24164cecb4ae2ce10787191c2b6c582", "sha256": "50d0fd5761f9af5ef532578b8cde54b41568ae34b61b453a36e94fe982e28253" }, "downloads": -1, "filename": "jira-cloud-python-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d24164cecb4ae2ce10787191c2b6c582", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6768, "upload_time": "2019-08-27T15:33:19", "url": "https://files.pythonhosted.org/packages/f3/f6/7be46b21d257425d88174827461b3a3e9960dee3bd688fb02a05c44a936d/jira-cloud-python-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d24164cecb4ae2ce10787191c2b6c582", "sha256": "50d0fd5761f9af5ef532578b8cde54b41568ae34b61b453a36e94fe982e28253" }, "downloads": -1, "filename": "jira-cloud-python-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d24164cecb4ae2ce10787191c2b6c582", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6768, "upload_time": "2019-08-27T15:33:19", "url": "https://files.pythonhosted.org/packages/f3/f6/7be46b21d257425d88174827461b3a3e9960dee3bd688fb02a05c44a936d/jira-cloud-python-1.0.0.tar.gz" } ] }