Example #1
0
    ))
    workitem_list = [workitem]
    children_list = workitem.getChildren()
    if children_list:
        for child in children_list:
            workitem_list += get_workitem_list(child)

    return workitem_list


if __name__ == '__main__':
    arguments = docopt(__doc__, version='RTC Delta')
    if arguments['--logs']:
        setup_basic_logging()
    else:
        logging.basicConfig(level=logging.CRITICAL)

    rtc_client = RTCClient(arguments['--url'],
                           arguments['--user'],
                           arguments['--pass'],
                           ends_with_jazz=arguments['--endsWithJazz'])

    ensure_path_exists(arguments['--beforePath'])
    ensure_path_exists(arguments['--afterPath'])
    workitem = rtc_client.getWorkitem(arguments['--workitem'])
    if arguments['--children']:
        for child in get_workitem_list(workitem):
            get_changes(child)
    else:
        get_changes(workitem)
Example #2
0
from rtcclient.client import RTCClient
from rtcclient.utils import setup_basic_logging
import os.path


def ensure_path_exists(path):
    if not os.path.exists(path):
        os.mkdir(path)


if __name__ == '__main__':
    arguments = docopt(__doc__, version='RTC Delta')
    if arguments["--logs"]:
        setup_basic_logging()
    rtc_client = RTCClient(arguments["--url"],
                           arguments["--user"],
                           arguments["--pass"],
                           ends_with_jazz=arguments["--endsWithJazz"])
    ensure_path_exists(arguments["--beforePath"])
    ensure_path_exists(arguments["--afterPath"])
    work_item = rtc_client.getWorkitem(
        arguments["--workitem"]
    )  # ,returned_properties="dc.ientifier,dc:title,rtc_cm:com.ibm.team.filesystem.workitems.change_set.com.ibm.team.scm.ChangeSet"
    print("%s : %s" % (work_item.identifier, work_item.title))
    changesets = work_item.getChangeSets()
    for changeset in changesets:
        print("Traversing %s" % changeset)
        for change in changeset.getChanges():
            print("Extracting before&after for change: %s" % change.comment)
            change.fetchBeforeStateFile(arguments["--beforePath"])
            change.fetchAfterStateFile(arguments["--afterPath"])
Example #3
0
from rtcclient.client import RTCClient
from rtcclient.utils import setup_basic_logging


if __name__ == "__main__":
    # you can remove this if you don't need logging
    # default logging for console output
    setup_basic_logging()

    url = "https://your_domain:9443/jazz"
    username = "******"
    password = "******"
    myclient = RTCClient(url, username, password)

    # change workitem id here
    workitem_id = 123456
    wk = myclient.getWorkitem(workitem_id)
    wk.addComment("changeme: add comments here")