Package tlib :: Package base :: Module JiraModerator :: Class JiraModerator |
[hide private]
[frames] | no frames]

# Class JiraModerator

source code

    object --+
             |
            JiraModerator

Helper class to connect and manipulate the data in Jira

Instance Methods | [hide private]
__init__(self, logger) Constructor for class | source code
bool |
connect(self) Establishes a connection to our YPG Jira instance and assignes it to self.client | source code
ResultList |
search_for_issue(self, query) Returns a list of issues that were returned by Jira given the query you specified | source code
bool |
confirm_version(self, proj_key, build_version) Confirms that the project version supplied actually exists in Jira for the specified project | source code
dict |
get_required_fields(self, project_key, issue_type=None) Fetches a list of fields that require values to open a new issue in a specified project | source code
bool |
create_issue(self, data) Creates an issue in Jira with the dictionary of data supplied. | source code
bool |
reopen_bug(self, issue, proj_key, version) Transitions a specified jira Bug from any resolved state back to In Review and assigns it to the project lead with comments | source code
str |
get_transition_id(self, trans_dict, trans_name) Fetch the id for a transition's name | source code
dict |
prepare_issue_data(self, req_fields, test_id, project, summary, description, component, severity, version) Constructs a properly formatted dictionary of data to supply to Jira for opening an issue. | source code
get_project_key(self, proj_name=`'````'`) Returns: (str) Project acronym / key from Jira | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables | [hide private]
| client = `None`
| clientOptions = ``{``'``server``'``:` `'``https://issues.ypg.com``'``}`` connection options for Jira
| username = ``'``ypgAutoTester``'`` Automation User username (QA Lead access to Jira)
| password = ``'``@ut0t3$t3r``'`` Automation User password
| logger = `None` logger to send loggin information to.
| project = `None`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, logger) (Constructor) | source code
Constructor for class Parameters: `logger` (Logger) - instance of a logging object configured in testing project Overrides: object.__init__

### connect(self) | source code
Establishes a connection to our YPG Jira instance and assignes it to self.client Returns: bool True if we are connected to Jira and False if we are not

### search_for_issue(self, query) | source code
Returns a list of issues that were returned by Jira given the query you specified Parameters: `query` (: str) - A string representation of a JQL query. anything you can enter in Jira advanced search can be entered here. Returns: ResultList a list of jira issues

### confirm_version(self, proj_key, build_version) | source code
Confirms that the project version supplied actually exists in Jira for the specified project Parameters: `proj_key` (str) - the Jira project acronym `build_version` (str) - the version of the application you are testing Returns: bool True if the version was found in Jira. False if the version was not found

### get_required_fields(self, project_key, issue_type=None) | source code
Fetches a list of fields that require values to open a new issue in a specified project Parameters: `project_key` (str) - The Jira project acronym for the project you are querying `issue_type` (str) - Optional issue type Names. Single name or coma delimited string Returns: dict a dictionary containing the required fields and None values for each. Returns empty dict if search failed.

### create_issue(self, data) | source code
Creates an issue in Jira with the dictionary of data supplied. Be sure that data contains all required fields before using this. Parameters: `data` (dict) - dictionary of required fields and valid values Returns: bool returns True if issues was created and False if there was a failure

### reopen_bug(self, issue, proj_key, version) | source code
Transitions a specified jira Bug from any resolved state back to In Review and assigns it to the project lead with comments Parameters: `issue` (issue) - an issue object that came from Jira. Use searchForIssue first before reopening issues `proj_key` (str) - the Jira project acronym from Jira `version` (str) - the build number currently under test where the bug was rediscovered Returns: bool returns False if we could not reopen issue and True if we could

### get_transition_id(self, trans_dict, trans_name) | source code
Fetch the id for a transition's name Parameters: `trans_dict` (dict) - a dictionary of transitions fetched from Jira for a given issue `trans_dict` (dict) - name of the Jira transition you would like the id for `trans_name` (str) Returns: str a numeric id associtated to the transition name

### prepare_issue_data(self, req_fields, test_id, project, summary, description, component, severity, version) | source code
Constructs a properly formatted dictionary of data to supply to Jira for opening an issue. Creates a bug in the specified project After construction, it will validate the dictionary by checking if all required fields are filled Parameters: `req_fields` (dict) - dictionary of jira project required fields. Construct the dict with getRequiredFields `test_id` (str) - the name of the test cases found in the test case's decoreator in python or the name in Spiratest `project` (str) - the Jira project acronym for the project you wish to open a bug inspect `summary` (str) - the summary of the bug you wish to open `description` (str) - the description of the bug you wish to open `component` (str) - the component of the bug you wish to open `severity` (str) - the severity of the bug you wish to open `version` (str) - the affected version of the bug you wish to open Returns: dict if the dictionary properly complies to all the required fields. Returns emtpy dict if it does not.

### get_project_key(self, proj_name=`'````'`) | source code
Parameters: `proj_name` - (str) Name of Project in Jira Returns: (str) Project acronym / key from Jira