Ejemplo n.º 1
0
def main():
    jira = JIRA()
    JIRA(options={'server': 'http://localhost:8100'})
    projects = jira.projects()
    print projects
    for project in projects:
        print project.key
Ejemplo n.º 2
0
 def connect_to_jira(context):
     jira_server = {'server': settings.jira_server}
     global jira
     if settings.use_proxy:
         jira = JIRA(options=jira_server, basic_auth=(settings.jira_user, settings.jira_password), proxies={"http": "http://zscaler.test.com:80", "https": "https://zscaler.star.com.au:80"})
     else:
         jira = JIRA(options=jira_server, basic_auth=(settings.jira_user, settings.jira_password))
Ejemplo n.º 3
0
    def connect_to_jira(self,
                        JIRAUsername=None,
                        JIRAPassword=None,
                        options=None):
        """
        Connect to a JIRA server.

            Arguments:
                |  JIRAUsername (string)  	|  (Optional) A JIRA Username you wish to authenticate with, will authorise with anonymous account if left empty      				|
                |  JIRAPassword (string)  	|  (Optional) If a username was specified and a password is not the user will be prompted for password at runtime 					|
                |  options (dictionary) 	|  (Optional) A dictionary of options that the JIRA connection will be initialied with 	                                            |

            This must be called first to be able to do most JIRA actions such as creating a new issue and assigning users.
            When connecting to JIRA you may need to authenticate a user. This can be done by passing in Username and Password as parameters. However, should you wish to not have a sensitive password saved in a file,  an option is available to not pass in a Password and a prompt will appear asking for the JIRA password at runtime.


            'connect to jira' can be called on its own and will default options to:
                '{'rest_api_version': '2', 'verify': True,
                'server': 'http://*****:*****@ssword 						| {'server': http://devjira01'} 	|
        """

        if JIRAUsername is not None and (JIRAPassword is ""
                                         or JIRAPassword is None):
            JIRAPassword = getpass.getpass("\nJIRA Password: "******"\nAuthentication to JIRA unsuccessful. Ensure the user used has sufficient access and that Username and Password were correct\n\n"
                )
                sys.exit(1)

        else:
            try:
                self.jira = JIRA(options=JIRAOptions,
                                 basic_auth=(str(JIRAUsername),
                                             str(JIRAPassword)))
            except:
                sys.__stdout__.write(
                    "\nAuthentication to JIRA unsuccessful. Ensure the user used has sufficient access and that Username and Password were correct\n\n"
                )
                sys.exit(1)
Ejemplo n.º 4
0
 def __init__(self, server, username, password):
     __options = None
     __oauth = None
     __validate = None
     __async = False
     __logging = False
     self.jira_client = JIRA(server, __options, (username, password), __oauth, __validate, __async, __logging)
Ejemplo n.º 5
0
    def setup(self):
        self._jira_url = self._config['jira_url']
        rsa_cert_file = self._config['rsa_cert_file']
        if not os.path.exists(rsa_cert_file):
            raise Exception('Cert file for JIRA OAuth not found at %s.' %
                            rsa_cert_file)
        self._rsa_key = self._read_cert(rsa_cert_file)
        self._poll_interval = self._config.get('poll_interval',
                                               self._poll_interval)
        oauth_creds = {
            'access_token': self._config['oauth_token'],
            'access_token_secret': self._config['oauth_secret'],
            'consumer_key': self._config['consumer_key'],
            'key_cert': self._rsa_key
        }

        self._jira_client = JIRA(options={'server': self._jira_url},
                                 oauth=oauth_creds)
        if self._projects_available is None:
            self._projects_available = set()
            for proj in self._jira_client.projects():
                self._projects_available.add(proj.key)
        self._project = self._config.get('project', None)
        if not self._project or self._project not in self._projects_available:
            raise Exception('Invalid project (%s) to track.' % self._project)
        self._jql_query = 'project=%s' % self._project
        all_issues = self._jira_client.search_issues(self._jql_query,
                                                     maxResults=None)
        self._issues_in_project = {issue.key: issue for issue in all_issues}
Ejemplo n.º 6
0
    def is_bug_open(cls, issue_id):
        """Checks if the JIRA issue is open. An issue is open if its status is
        not in the closed_statuses list, or if none of its labels are in the
        closed_labels list.
        """

        log = logging.getLogger('RunnerLog')

        config = JiraTrackerConfig()

        issue = None
        try:
            # exceptions from requests can bubble up here
            jira = JIRA(options={'server': config.server})

            # returns an Issue object; JIRAError on invalid id
            issue = jira.issue(issue_id)
        except JIRAError as error:
            log.info('Error getting issue from JIRA. '
                     'JIRAError: {0}'.format(error))
        except RequestException as error:
            log.info('Unable to connect to JIRA server {0}. '
                     'RequestException: {1}'.format(config.server, error))

        if cls._status_is_open(issue, config):
            return True
        elif cls._labels_are_open(issue, config):
            return True
        return False
Ejemplo n.º 7
0
 def authenticate(self):
     server = urlparse.urlparse(self.url)
     server = server.scheme + "://" + server.netloc
     self._client = JIRA(server=server, basic_auth=self.auth)
     c = self._client.component(self.url.split("/")[-1])
     self.component = c.name
     self.project = c.projectId
Ejemplo n.º 8
0
def auth_jira_basic(config):
    options = {'server': config.jira.server or input('\nJira Server: ')}
    username = config.jira.username or input('\nJira Username: ')
    password = config.jira.password or getpass()
    auth = (username, password)
    jira = JIRA(options, basic_auth=auth)
    return jira
Ejemplo n.º 9
0
 def _createConnection(self):
     jira_server = {'server': self.serverURL}
     jira_auth = (self.jiraUsername,self.jiraPassword)
     try:
         self.jiraConn = JIRA(options=jira_server,basic_auth=jira_auth)
     except Exception, e:
         self.raiseError("Unable to create connection to JIRA", e)
Ejemplo n.º 10
0
def init_jira(config={}):
    """
    Load Configuration from config.yaml
    
    Configuration may be held in either ~/.jira/config.yaml or ./config.yaml

    This is no longer compatible with previous config.yaml login configuration
    """
    auth = (config['username'], config['password'])
    host = config['host']
    server = {'server': host}
    if 'verify' in  config:
        verified = "verified"
        # Make certificate file relative to config file...
        config_directory = "" if 'config_directory' not in config else config['config_directory']
        server['verify'] = config_directory+'/'+config['verify']
    else:
        verified = "unverified"
        # -- Following code is supposed to ignore a certificate error, but it doesn't. :-(
        import requests
        from requests.packages.urllib3.exceptions import InsecureRequestWarning
        requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

    # Connect to JIRA
    try:
        log.logger.info( "Connecting to %s using %s connection.", host, verified)
        jira = JIRA(server, basic_auth=auth)
    except Exception as e:
        log.logger.fatal( e, exc_info=True )
        log.logger.fatal( "Failed to connect to JIRA." )
        raise e

    return jira
Ejemplo n.º 11
0
def create_jira_ticket(serv, creds, description, JIRA):
    creds = creds.split(":")
    options = {"server": "https://jira.yelpcorp.com"}
    jira_cli = JIRA(options=options,
                    basic_auth=(creds[0], creds[1]))  # noqa: F821
    jira_ticket = {}
    # Sometimes a project has required fields we can't predict
    try:
        jira_ticket = {
            "project": {
                "key": serv["project"]
            },
            "description":
            description,
            "issuetype": {
                "name": "Improvement"
            },
            "labels": ["perf-watching", "paasta-rightsizer"],
            "summary":
            "{s}.{i} in {c} may be {o}provisioned".format(
                s=serv["service"],
                i=serv["instance"],
                c=serv["cluster"],
                o=serv["state"],
            ),
        }
        tick = jira_cli.create_issue(fields=jira_ticket)
    except Exception:
        jira_ticket["project"] = {"key": "PEOBS"}
        jira_ticket["labels"].append(serv["service"])
        tick = jira_cli.create_issue(fields=jira_ticket)
    return tick.key
Ejemplo n.º 12
0
 def setup(self):
     # Setup stuff goes here. For example, you might establish connections
     # to external system once and reuse it. This is called only once by the system.
     self._jira_client = JIRA('http://jira-ams.demodxc.com',
                              auth=('autoresolver', 'password'))
     self._logger = self.sensor_service.get_logger(
         name=self.__class__.__name__)
Ejemplo n.º 13
0
    def __init__(self, jira_file):
        try:
            with open(jira_file) as jf:
                data = jf.read()
                data = yaml.load(data)
                self.account = data['account']
                self.password = data['password']
                self.project = data['project']
                self.server = data['server']
                self.issue_type = data['issue_type']
                self.url = data['url']
                self.disable_transitions = data.get('disable_transitions',
                                                    False)
        except KeyError as e:
            raise Exception(
                'JIRA sync configuration missing required field: {}'.format(e))
        except IOError as e:
            raise Exception(
                'Error opening JIRA sync configuration file: {}'.format(e))
        except yaml.scanner.ScannerError as e:
            raise Exception(
                'JIRA sync configuration file contains malformed YAML: {}'.
                format(e))

        try:
            self.client = JIRA(self.server,
                               basic_auth=(self.account, self.password))
        except Exception as e:
            raise Exception("Error connecting to JIRA: {}".format(
                str(e)[:1024]))
Ejemplo n.º 14
0
def helperFunc1(confluenceUrl, jiraUrl):
    global confluence
    global jira
    if nameEnter.get() and not nameEnter.get().isspace():
        confluenceName = nameEnter.get()
        confluencePass = passwordEnter.get()
        confluence = Confluence(url=confluenceUrl,
                                username=confluenceName,
                                password=confluencePass)
        #try:
        jira = JIRA(jiraUrl, auth=(nameEnter.get(), passwordEnter.get()))
        textBox.insert(END, "logged in as " + nameEnter.get() + "\n")
        window.deiconify()
        top.destroy()
        jqlSearch = f'project=HR and status = open order by "cf[11200]" asc'
        issues = jira.search_issues(jqlSearch)
        for issue in issues:
            if (str(issue.fields.status) == 'Open'
                    and not issue.fields.customfield_11705):
                openBox.insert(END, issue.fields.summary)
        openBox.select_set(0)
        openBox.bind("<Double-Button-1>", OnDouble)
        #except Exception as e:
        #print e.status_code, e.text
        #    messageBox.showinfo("Login Failed","Login Failed. Please try again\n(You may have trigger captcha from too many failed login. Please login to jira directly and clear it)")
    else:
        messageBox.showinfo("Failure",
                            "Please enter both username and password")
Ejemplo n.º 15
0
    def __init__(self, args, mongo=None):
        if not isinstance(args, dict):
            args = vars(args)
        self.args = args
        self.live = False

        logging.basicConfig(format='%(asctime)s - %(module)s - %(levelname)s -'
                                   ' %(message)s')
        self.logger = logging.getLogger("logger")
        self.logger.setLevel(self.args['log_level'])
        fh = logging.FileHandler(self.args['log'])
        self.logger.addHandler(fh)

        self.logger.info("Initializing JIRA++")
        self.logger.debug(self.args)

        if mongo is None:
            try:
                self.mongo = pymongo.MongoClient(self.args['mongo_uri'])
            except pymongo.errors.PyMongoError as e:
                self.logger.exception(e)
                raise e
        else:
            self.mongo = mongo

        # Initialize dbs and collections
        self.db_jirameta = self.mongo.jirameta

        opts = {'server': 'https://jira.mongodb.org', "verify": False}
        auth = (self.args['jira_username'], self.args['jira_password'])

        try:
            self.jira = JIRA(options=opts, basic_auth=auth)
        except JIRAError as e:
            raise e
Ejemplo n.º 16
0
 def GetJIRA(self,JIRA_Server,AuthorizationDataFileNameInCurrentFolder):
     certfile = wincertstore.CertFile()
     certfile.addstore("CA")
     certfile.addstore("ROOT")
     options = {'server': JIRA_Server,'verify':certfile.name}
     UserName,UserPassword = self.GetAuthInfo(AuthorizationDataFileNameInCurrentFolder)
     return JIRA(options,basic_auth=(UserName,UserPassword))
Ejemplo n.º 17
0
    def setUp(self):
        super(IntegrationTestBase, self).setUp()

        self.jira_configured = True

        jira_env_settings = {
            "username": "******",
            "url": "INTEGRATION_TESTING_URL",
            "project": "INTEGRATION_TESTING_PROJECT",
            "password": "******",
        }
        self.jira_env = {}
        for key, env_var in jira_env_settings.items():
            try:
                self.jira_env[key] = os.environ[env_var]
            except KeyError:
                raise SkipTest(
                    "Integration tests require the following environment "
                    "variables to be set: %s" %
                    (", ".join([v for k, v in jira_env_settings.items()])))

        self.jira = JIRA(
            {"server": self.jira_env["url"]},
            basic_auth=(
                self.jira_env["username"],
                self.jira_env["password"],
            ),
        )

        self.created_issues = []
        self.path = tempfile.mkdtemp()
Ejemplo n.º 18
0
    def setUp(self):
        super(IntegrationTestBase, self).setUp()

        self.jira_configured = True

        jira_env_settings = {
            'username': '******',
            'url': 'INTEGRATION_TESTING_URL',
            'project': 'INTEGRATION_TESTING_PROJECT',
            'password': '******',
        }
        self.jira_env = {}
        for key, env_var in jira_env_settings.items():
            try:
                self.jira_env[key] = os.environ[env_var]
            except KeyError:
                raise SkipTest(
                    "Integration tests require the following environment "
                    "variables to be set: %s" %
                    (', '.join([v for k, v in jira_env_settings.items()])))

        self.jira = JIRA({'server': self.jira_env['url']},
                         basic_auth=(
                             self.jira_env['username'],
                             self.jira_env['password'],
                         ))

        self.created_issues = []
        self.path = tempfile.mkdtemp()
Ejemplo n.º 19
0
def main():
    jira = JIRA(options={'server': jira_url},
                basic_auth=(jira_user, jira_pass))
    jenkins = Jenkins(jenkins_url, jenkins_user, jenkins_pass)

    logger.info('Get all projects')
    projects = jira.projects()

    logger.info('Get all versions')
    #key: <JIRA Project: key=u'SE', name=u'\u641c\u7d22\u5f15\u64ce', id=u'10750'>
    #value: [<JIRA Version: name=u'v1.0', id=u'11312'>, ...]
    project_version_map = dict([
        z for z in zip([jira.project(project.id) for project in projects],
                       [jira.project_versions(p.id) for p in projects])
        if len(z[1]) != 0
    ])
    logger.debug(
        "All project and its versions: {0}".format(project_version_map))

    for project, versions in project_version_map.items():
        for version in versions:
            try:
                create_job_for_version(project, version, jenkins)
            except Exception as e:
                logger.critical(
                    'failed to create job: {0}!! Reason: \n{1}'.format(
                        project.key,
                        ''.join(traceback.format_exception(*sys.exc_info()))))
Ejemplo n.º 20
0
def create_jira_ticket(serv, creds, description):
    creds = creds.split(':')
    options = {'server': 'https://jira.yelpcorp.com'}
    jira_cli = JIRA(options=options, basic_auth=(creds[0], creds[1]))
    jira_ticket = {}
    # Sometimes a project has required fields we can't predict
    try:
        jira_ticket = {
            'project': {
                'key': serv['project']
            },
            'description':
            description,
            'issuetype': {
                'name': 'Improvement'
            },
            'labels': ['perf-watching', 'paasta-rightsizer'],
            'summary':
            "{s}.{i} in {c} may be {o}provisioned".format(
                s=serv['service'],
                i=serv['instance'],
                c=serv['cluster'],
                o=serv['state'],
            ),
        }
        tick = jira_cli.create_issue(fields=jira_ticket)
    except Exception:
        jira_ticket['project'] = {'key': 'PERF'}
        jira_ticket['labels'].append(serv['service'])
        tick = jira_cli.create_issue(fields=jira_ticket)
    return tick.key
Ejemplo n.º 21
0
def queryJira2():
    jira_server = "https://www.myjira.nl"
    jira_user = "******"
    jira_password = "******"

    jira_server = {'server': jira_server}
    jira = JIRA(options=jira_server, basic_auth=(jira_user, jira_password))
    print("Entry into jira successfull")
    jql = 'project = KWCMSLIVE AND issuetype in standardIssueTypes() AND status in (Closed, Done)'
    block_size = 100
    block_num = 0
    while True:
        start_idx = block_num * block_size
        issues = jira.search_issues(jql, start_idx, block_size)
        if len(issues) == 0:
            # Retrieve issues until there are no more to come
            break
        block_num += 1
        for issue in issues:
            issueSummaryLexeme = ChatHandler.parseText(issue.fields.summary)
            insertQuery = dict()
            insertQuery['issueKey'] = issue.key
            insertQuery['issueId'] = issue.id
            insertQuery['issueSummary'] = issue.fields.summary
            insertQuery['issueSummaryLexeme'] = issueSummaryLexeme
            db2.jiradatasource.insert_one(insertQuery)
Ejemplo n.º 22
0
 def get_Jira(self):
     """
     Returns Jira instance running on server
     """
     options = {'server': self.server}
     jira = JIRA(options, basic_auth=(self.username, self.password))
     return jira
Ejemplo n.º 23
0
    def __init__(self, rule):
        super(JiraAlerter, self).__init__(rule)
        self.server = self.rule['jira_server']
        self.get_jira_account(self.rule['jira_account_file'])
        self.project = self.rule['jira_project']
        self.issue_type = self.rule['jira_issuetype']
        self.component = self.rule.get('jira_component')
        self.label = self.rule.get('jira_label')
        self.assignee = self.rule.get('jira_assignee')
        self.max_age = self.rule.get('jira_max_age', 30)
        self.bump_tickets = self.rule.get('jira_bump_tickets', False)

        self.jira_args = {
            'project': {
                'key': self.project
            },
            'issuetype': {
                'name': self.issue_type
            }
        }

        if self.component:
            self.jira_args['components'] = [{'name': self.component}]
        if self.label:
            self.jira_args['labels'] = [self.label]
        if self.assignee:
            self.jira_args['assignee'] = {'name': self.assignee}

        try:
            self.client = JIRA(self.server,
                               basic_auth=(self.user, self.password))
        except JIRAError as e:
            # JIRAError may contain HTML, pass along only first 1024 chars
            raise EAException("Error connecting to JIRA: %s" % (str(e)[:1024]))
Ejemplo n.º 24
0
    def __init__(self, *args, **kw):
        super(JiraService, self).__init__(*args, **kw)
        self.username = self.config_get('username')
        self.url = self.config_get('base_uri')
        password = self.config_get('password')
        if not password or password.startswith("@oracle:"):
            password = get_service_password(
                self.get_keyring_service(self.config, self.target),
                self.username,
                oracle=password,
                interactive=self.config.interactive)

        default_query = 'assignee=' + self.username + \
            ' AND resolution is null'
        self.query = self.config_get_default('query', default_query)
        self.jira = JIRA(options={
            'server':
            self.config_get('base_uri'),
            'rest_api_version':
            'latest',
            'verify':
            self.config_get_default('verify_ssl', default=None,
                                    to_type=asbool),
        },
                         basic_auth=(self.username, password))
        self.import_labels_as_tags = self.config_get_default(
            'import_labels_as_tags', default=False, to_type=asbool)
        self.label_template = self.config_get_default('label_template',
                                                      default='{{label}}',
                                                      to_type=six.text_type)
Ejemplo n.º 25
0
def get_jira():
    options = {'server': 'https://issues.apache.org/jira'}

    jira_config = get_jira_config()
    jira = JIRA(options,
                basic_auth=(jira_config['user'], jira_config['password']))
    return jira
Ejemplo n.º 26
0
def post_to_jira():

    jira=JIRA(basic_auth=(uid,jpwd),options={'server': 'https://jira.client.com','headers': {'X-Atlassian-Token': 'nocheck'}})
    
    workbook = xlrd.open_workbook(logname)
    worksheet = workbook.sheet_by_index(0)
    wb = copy(workbook)
    w_sheet = wb.get_sheet(0)

    num_rows = worksheet.nrows - 1
    num_cells = worksheet.ncols - 1
    curr_row = 0
    while curr_row < num_rows:
        curr_row+=1
        issue=jira.issue(worksheet.cell_value(curr_row, 0))
        curr_status = worksheet.cell_value(curr_row, 5)
        comment = worksheet.cell_value(curr_row, 6)
        spoolfile= working_dir+"\\"+worksheet.cell_value(curr_row,0)+"\\"+worksheet.cell_value(curr_row,4)
        # print spoolfile
        if curr_status=="DEPLOYED":
            jira.add_comment(issue,comment)            
            jira.add_attachment(issue,spoolfile)
            jira.assign_issue(issue,'sqadepartment')
            w_sheet.write(curr_row,5,"COMPLETED")
            webbrowser.open_new_tab('https://jira.client.com/browse/'+issue.key)
            
    wb.save(logname)
Ejemplo n.º 27
0
    def __init__(self, rule):
        super(JiraAlerter, self).__init__(rule)
        self.server = self.rule['jira_server']
        self.get_account(self.rule['jira_account_file'])
        self.project = self.rule['jira_project']
        self.issue_type = self.rule['jira_issuetype']

        # Deferred settings refer to values that can only be resolved when a match
        # is found and as such loading them will be delayed until we find a match
        self.deferred_settings = []

        # We used to support only a single component. This allows us to maintain backwards compatibility
        # while also giving the user-facing API a more representative name
        self.components = self.rule.get('jira_components',
                                        self.rule.get('jira_component'))

        # We used to support only a single label. This allows us to maintain backwards compatibility
        # while also giving the user-facing API a more representative name
        self.labels = self.rule.get('jira_labels', self.rule.get('jira_label'))

        self.description = self.rule.get('jira_description', '')
        self.assignee = self.rule.get('jira_assignee')
        self.max_age = self.rule.get('jira_max_age', 30)
        self.priority = self.rule.get('jira_priority')
        self.bump_tickets = self.rule.get('jira_bump_tickets', False)
        self.bump_not_in_statuses = self.rule.get('jira_bump_not_in_statuses')
        self.bump_in_statuses = self.rule.get('jira_bump_in_statuses')
        self.bump_after_inactivity = self.rule.get(
            'jira_bump_after_inactivity', 0)
        self.bump_only = self.rule.get('jira_bump_only', False)
        self.transition = self.rule.get('jira_transition_to', False)
        self.watchers = self.rule.get('jira_watchers')
        self.client = None

        if self.bump_in_statuses and self.bump_not_in_statuses:
            msg = 'Both jira_bump_in_statuses (%s) and jira_bump_not_in_statuses (%s) are set.' % \
                  (','.join(self.bump_in_statuses), ','.join(self.bump_not_in_statuses))
            intersection = list(
                set(self.bump_in_statuses) & set(self.bump_in_statuses))
            if intersection:
                msg = '%s Both have common statuses of (%s). As such, no tickets will ever be found.' % (
                    msg, ','.join(intersection))
            msg += ' This should be simplified to use only one or the other.'
            elastalert_logger.warning(msg)

        self.reset_jira_args()

        try:
            self.client = JIRA(self.server,
                               basic_auth=(self.user, self.password))
            self.get_priorities()
            self.jira_fields = self.client.fields()
            self.get_arbitrary_fields()
        except JIRAError as e:
            # JIRAError may contain HTML, pass along only first 1024 chars
            raise EAException("Error connecting to JIRA: %s" %
                              (str(e)[:1024])).with_traceback(
                                  sys.exc_info()[2])

        self.set_priority()
Ejemplo n.º 28
0
def jira_fetch():

    try:
        jira=JIRA(basic_auth=(uid,jpwd),options={'server': 'https://jira.client.com','headers': {'X-Atlassian-Token': 'nocheck'}})
    except:
        print "Bad JIRA Password, exiting."
        exit()
    create_book()
    my_list = jira.search_issues('(project = DP OR project = ET OR project = Configuration) AND resolution = Unresolved AND (assignee = datacenter OR assignee = dba OR assignee = noc_change_manager) AND project = DP AND assignee = noc_change_manager AND "NOC Personnel Involved" = dba ORDER BY key ASC')
    
    workbook = xlrd.open_workbook(logname)
    worksheet = workbook.sheet_by_index(0)
    wb = copy(workbook)
    w_sheet = wb.get_sheet(0)
    seq_counter=0
    for i in my_list:
        seq_counter+=1
        issue=i
        print issue.key+"---"+issue.fields.summary
        w_sheet.write(seq_counter,0,issue.key)
        if issue.fields.customfield_12720!=None:
            w_sheet.write(seq_counter,1,str(issue.fields.customfield_12720))
        if issue.fields.customfield_12721!=None:
            w_sheet.write(seq_counter,2,str(issue.fields.customfield_12721))
	webbrowser.open_new_tab('https://jira.client.com/browse/'+issue.key)
        
        if not os.path.exists(issue.key):
            os.mkdir(issue.key)

    os.chdir(working_dir)
    wb.save(logname)
Ejemplo n.º 29
0
    def __init__(self):
        options = {
            'server': 'https://jira-server.com',
        }

        self.jira = JIRA(basic_auth=('admin', 'admin'), options=options)

        self.total_stories = 0
        self.total_points = 0

        self.ready_to_dev_points = 0
        self.ready_to_dev_stories = 0

        self.in_dev_points = 0
        self.in_dev_stories = 0

        self.ready_to_test_points = 0
        self.ready_to_test_stories = 0

        self.in_test_points = 0
        self.in_test_stories = 0

        self.ready_to_deliver_points = 0
        self.ready_to_deliver_stories = 0

        self.archived_points = 0
        self.archived_stories = 0
Ejemplo n.º 30
0
 def connect(self, patched=False):
     if patched:
         #Patched is for deprecated requests API
         self.jira = patchedJira.connectToJira()
     else:
         options = {'server': 'https://jira.secondlife.com'}
         self.jira = JIRA(options)