Skip to content

Commit

Permalink
UPDATE index.html file (the code example) with the changes for 'ticke…
Browse files Browse the repository at this point in the history
…t' and 't' object.

ADD the return statements section under Usage file.
UPDATE Bugzilla.rst, JIRA.rst, Redmine.rst, ServiceNow.rst, Usage.rst, index.rst, rt.rst for changes of object with 'ticket'.
  • Loading branch information
K-Gazdikova committed Jun 22, 2017
1 parent 0e1b34f commit 6ca44b0
Show file tree
Hide file tree
Showing 7 changed files with 169 additions and 131 deletions.
50 changes: 25 additions & 25 deletions read-the-docs/source/Bugzilla.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fields.

.. code:: python
t.create(summary='Ticket summary',
t = ticket.create(summary='Ticket summary',
description='Ticket description')
The following keyword arguments were tested and accepted by our
Expand Down Expand Up @@ -64,7 +64,7 @@ ticket fields.

.. code:: python
t.edit(summary='Ticket summary')
t = ticket.edit(summary='Ticket summary')
The following keyword arguments were tested and accepted by our
particular Bugzilla instance during ticket editing:
Expand All @@ -91,7 +91,7 @@ specify comment options.

.. code:: python
t.add_comment('Test comment')
t = ticket.add_comment('Test comment')
change_status()
---------------
Expand All @@ -105,8 +105,8 @@ bug ID.

.. code:: python
t.change_status('NEW')
t.change_status('CLOSED', resolution='DUPLICATE', dupe_of='<bug_id>')
t = ticket.change_status('NEW')
t = ticket.change_status('CLOSED', resolution='DUPLICATE', dupe_of='<bug_id>')
remove_cc()
-----------
Expand All @@ -119,7 +119,7 @@ users.

.. code:: python
t.remove_cc('username@mail.com')
t = ticket.remove_cc('username@mail.com')
add_cc()
--------
Expand All @@ -132,7 +132,7 @@ users.

.. code:: python
t.add_cc(['username1@mail.com', 'username2@mail.com'])
t = ticket.add_cc(['username1@mail.com', 'username2@mail.com'])
add_attachment()
----------------
Expand All @@ -144,7 +144,7 @@ specify additional attachment options.

.. code:: python
t.add_attachment(file_name='Name to be displayed on UI',
t = ticket.add_attachment(file_name='Name to be displayed on UI',
data='Location(path) or contents of the attachment',
summary='A short string describing the attachment.')
Expand All @@ -165,7 +165,7 @@ http://bugzilla.readthedocs.io/en/latest/api/index.html.
.. code:: python
>>> from ticketutil.bugzilla import BugzillaTicket
>>> t = BugzillaTicket(<bugzilla_url>,
>>> ticket = BugzillaTicket(<bugzilla_url>,
<product_name>,
auth=(<username>, <password>))
Expand All @@ -180,7 +180,7 @@ http://bugzilla.readthedocs.io/en/latest/api/core/v1/general.html#authentication
.. code:: python
>>> from ticketutil.bugzilla import BugzillaTicket
>>> t = BugzillaTicket(<bugzilla_url>,
>>> ticket = BugzillaTicket(<bugzilla_url>,
<product_name>,
auth=({'api_key': '<your-api-key>'})
Expand Down Expand Up @@ -212,28 +212,28 @@ Create and update Bugzilla ticket
from ticketutil.bugzilla import BugzillaTicket
# Create a ticket object and pass the url and product name in as strings.
t = BugzillaTicket(<bugzilla_url>,
ticket = BugzillaTicket(<bugzilla_url>,
<product_name>,
auth=(<username>, <password>))
# Create a ticket and perform some common ticketing operations.
t.create(summary='Ticket summary',
t = ticket.create(summary='Ticket summary',
description='Ticket description',
component='Test component',
priority='high',
severity='medium',
assignee='username@mail.com',
qa_contact='username@mail.com',
groups='beta')
t.add_comment('Test Comment')
t.edit(priority='medium',
t = ticket.add_comment('Test Comment')
t = ticket.edit(priority='medium',
qa_contact='username@mail.com')
t.add_cc(['username1@mail.com', 'username2@mail.com'])
t.remove_cc('username1@mail.com')
t.change_status('Modified')
t = ticket.add_cc(['username1@mail.com', 'username2@mail.com'])
t = ticket.remove_cc('username1@mail.com')
t = ticket.change_status('Modified')
# Close Requests session.
t.close_requests_session()
ticket.close_requests_session()
Update existing Bugzilla tickets
--------------------------------
Expand All @@ -243,26 +243,26 @@ Update existing Bugzilla tickets
from ticketutil.bugzilla import BugzillaTicket
# Create a ticket object and pass the url, product name, and ticket id in as strings.
t = BugzillaTicket(<bugzilla_url>,
ticket = BugzillaTicket(<bugzilla_url>,
<product_name>,
auth=(<username>, <password>)
ticket_id=<ticket_id>)
# Perform some common ticketing operations.
t.add_comment('Test Comment')
t.edit(priority='low',
t = ticket.add_comment('Test Comment')
t = ticket.edit(priority='low',
severity='low',
groups='beta')
t.add_attchment(file_name='test_attachment.patch',
t = ticket.add_attchment(file_name='test_attachment.patch',
data=<contents/file-location>,
summary=<summary describing attachment>)
# Work with a different ticket.
t.set_ticket_id(<new_ticket_id>)
t.change_status(status='CLOSED', resolution='NOTABUG')
t = ticket.set_ticket_id(<new_ticket_id>)
t = ticket.change_status(status='CLOSED', resolution='NOTABUG')
# Close Requests session.
t.close_requests_session()
ticket.close_requests_session()
66 changes: 33 additions & 33 deletions read-the-docs/source/JIRA.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ Methods

- `create() <#create>`__
- `edit() <#edit>`__
- `add\_comment() <#comment>`__
- `change\_status() <#status>`__
- `remove\_all\_watchers() <#remove_all_watchers>`__
- `remove\_watcher() <#remove_watcher>`__
- `add\_watcher() <#add_watcher>`__
- `add\_attachment() <#add_attachment>`__
- `add_comment() <#comment>`__
- `change_status() <#status>`__
- `remove_all_watchers() <#remove_all_watchers>`__
- `remove_watcher() <#remove_watcher>`__
- `add_watcher() <#add_watcher>`__
- `add_attachment() <#add_attachment>`__

create()
--------
Expand All @@ -36,7 +36,7 @@ fields.

.. code:: python
t.create(summary='Ticket summary',
t = ticket.create(summary='Ticket summary',
description='Ticket description')
The following keyword arguments were tested and accepted by our
Expand Down Expand Up @@ -65,7 +65,7 @@ ticket fields.

.. code:: python
t.edit(summary='Ticket summary')
t = ticket.edit(summary='Ticket summary')
The following keyword arguments were tested and accepted by our
particular JIRA instance during ticket editing:
Expand All @@ -92,7 +92,7 @@ Adds a comment to a JIRA ticket.

.. code:: python
t.add_comment('Test comment')
t = ticket.add_comment('Test comment')
change_status()
---------------
Expand All @@ -103,7 +103,7 @@ Changes status of a JIRA ticket.

.. code:: python
t.change_status('In Progress')
t = ticket.change_status('In Progress')
remove_all_watchers()
---------------------
Expand All @@ -114,7 +114,7 @@ Removes all watchers from a JIRA ticket.

.. code:: python
t.remove_all_watchers()
t = ticket.remove_all_watchers()
remove_watcher()
----------------
Expand All @@ -125,7 +125,7 @@ Removes watcher from a JIRA ticket. Accepts an email or username.

.. code:: python
t.remove_watcher('username')
t = ticket.remove_watcher('username')
add_watcher()
-------------
Expand All @@ -136,7 +136,7 @@ Adds watcher to a JIRA ticket. Accepts an email or username.

.. code:: python
t.add_watcher('username')
t = ticket.add_watcher('username')
add_attachment()
----------------
Expand All @@ -147,7 +147,7 @@ Attaches a file to a JIRA ticket.

.. code:: python
t.add_attachment('filename.txt')
t = ticket.add_attachment('filename.txt')
Examples
Expand All @@ -161,7 +161,7 @@ Authenticate through HTTP Basic Authentication:
.. code:: python
>>> from ticketutil.jira import JiraTicket
>>> t = JiraTicket(<jira_url>,
>>> ticket = JiraTicket(<jira_url>,
<project_key>,
auth=('username', 'password'))
Expand All @@ -170,7 +170,7 @@ Authenticate through Kerberos after running ``kinit``:
.. code:: python
>>> from ticketutil.jira import JiraTicket
>>> t = JiraTicket(<jira_url>,
>>> ticket = JiraTicket(<jira_url>,
<project_key>,
auth='kerberos')
Expand Down Expand Up @@ -208,26 +208,26 @@ Create and update JIRA ticket
from ticketutil.jira import JiraTicket
# Create a ticket object and pass the url and project key in as strings.
t = JiraTicket(<jira_url>,
ticket = JiraTicket(<jira_url>,
<project_key>,
auth='kerberos')
# Create a ticket and perform some common ticketing operations.
t.create(summary='Ticket summary',
t = ticket.create(summary='Ticket summary',
description='Ticket description',
type='Task',
priority='Major',
assignee='username')
t.add_comment('Test Comment')
t.edit(priority='Critical',
t = ticket.add_comment('Test Comment')
t = ticket.edit(priority='Critical',
type='Bug')
t.remove_all_watchers()
t.add_watcher('username')
t.add_attachment('file_to_attach.txt')
t.change_status('In Progress')
t = ticket.remove_all_watchers()
t = ticket.add_watcher('username')
t = ticket.add_attachment('file_to_attach.txt')
t = ticket.change_status('In Progress')
# Close Requests session.
t.close_requests_session()
ticket.close_requests_session()
Update existing JIRA tickets
----------------------------
Expand All @@ -237,22 +237,22 @@ Update existing JIRA tickets
from ticketutil.jira import JiraTicket
# Create a ticket object and pass the url, project key, and ticket id in as strings.
t = JiraTicket(<jira_url>,
ticket = JiraTicket(<jira_url>,
<project_key>,
auth='kerberos',
ticket_id=<ticket_id>)
# Perform some common ticketing operations.
t.add_comment('Test Comment')
t.edit(priority='Critical',
t = ticket.add_comment('Test Comment')
t = ticket.edit(priority='Critical',
type='Bug')
# Work with a different ticket.
t.set_ticket_id(<new_ticket_id>)
t.remove_watcher('username')
t.add_watcher('username')
t.change_status('Done')
t = ticket.set_ticket_id(<new_ticket_id>)
t = ticket.remove_watcher('username')
t = ticket.add_watcher('username')
t = ticket.change_status('Done')
# Close Requests session.
t.close_requests_session()
ticket.close_requests_session()

0 comments on commit 6ca44b0

Please sign in to comment.