def get_project_tasks(projectPHID):
    """ get project phid by name
    :param projectPHID: str
    """
    p = phdb(db='phabricator_maniphest',
             user=phuser_user,
             passwd=phuser_passwd)
    _ = p.sql_x("SELECT src from edge \
                 WHERE dst=%s", (projectPHID), limit=None)
    p.close()
    if _ is None:
        return []
    p_ = list(util.tflatten(_))
    return p_
示例#2
0
def get_failed_creations(dbcon):
    """ get failed creations
    :param dbcon: db connector
    :returns: list
    """
    _ = dbcon.sql_x("SELECT id \
                    from bugzilla_meta \
                    where priority=%s", (6, ),
                    limit=None)
    if _ is None:
        return
    f_ = list(util.tflatten(_))
    if f_:
        return f_
def get_failed_creations(dbcon):
    """ get failed creations
    :param dbcon: db connector
    :returns: list
    """
    _ = dbcon.sql_x("SELECT id \
                    from bugzilla_meta \
                    where priority=%s",
                    (6,),
                    limit=None)
    if _ is None:
        return
    f_ = list(util.tflatten(_))
    if f_:
        return f_
示例#4
0
def get_project_tasks(projectPHID):
    """ get project phid by name
    :param projectPHID: str
    """
    p = phdb(db='phabricator_maniphest',
             user=phuser_user,
             passwd=phuser_passwd)
    _ = p.sql_x("SELECT src from edge \
                 WHERE dst=%s", (projectPHID),
                limit=None)
    p.close()
    if _ is None:
        return []
    p_ = list(util.tflatten(_))
    return p_
示例#5
0
def get_issues_by_priority(dbcon, priority, table):
    """ get failed creations
    :param dbcon: db connector
    :param priority: int
    :param table: str
    :returns: list
    """
    _ = dbcon.sql_x("SELECT id \
                    from %s \
                    where priority=%s" % (table, priority), (),
                    limit=None)
    if _ is None:
        return
    f_ = list(util.tflatten(_))
    if f_:
        return f_
def get_issues_by_priority(dbcon, priority, table):
    """ get failed creations
    :param dbcon: db connector
    :param priority: int
    :param table: str
    :returns: list
    """
    _ = dbcon.sql_x("SELECT id \
                    from %s \
                    where priority=%s" % (table, priority),
                    (),
                    limit=None)
    if _ is None:
        return
    f_ = list(util.tflatten(_))
    if f_:
        return f_
def add_task_cc(ticketphid, userphid):
    p = phdb(db='phabricator_maniphest',
             user=phuser_user,
             passwd=phuser_passwd)

    # Get json array of subscribers
    query = "SELECT dst FROM \
           edge WHERE src = %s and type=21"

    jcc_list = p.sql_x(query, ticketphid, limit=None)
    if jcc_list is None:
        cc_list = []
    else:
        cc_list = util.tflatten(jcc_list)
    if userphid not in cc_list:
        set_task_subscriber(ticketphid, userphid)
    p.close()
示例#8
0
def add_task_cc(ticketphid, userphid):
    p = phdb(db='phabricator_maniphest',
             user=phuser_user,
             passwd=phuser_passwd)

    # Get json array of subscribers
    query = "SELECT dst FROM \
           edge WHERE src = %s and type=21"

    jcc_list = p.sql_x(query, ticketphid, limit=None)
    if jcc_list is None:
        cc_list = []
    else:
        cc_list = util.tflatten(jcc_list)
    if userphid not in cc_list:
        set_task_subscriber(ticketphid, userphid)
    p.close()