0

My script creates issues in MKS Integrity (PTC) -lifecycle manager- and after an issue is created the issue ID is only shown in console response (or in GUI, but that's not an option for me).

The way issues are made

im createissue …
os.system('im createissue ...') # in python

The response is something like:

Editing fields ...
Adding attachments ...
Field Attachments: Attachment attachment.something: added
Adding field values ...
Submitting ...
Created ISSUE_NAME ISSUE_ID

How would you store the ISSUE_ID to reuse for editing? Issue's State(workflow) has to be modified right after the issue was created (has to be closed).

1 Answers1

0

You should use subprocess module to obtain child process's stdout:

result = subprocess.check_output('im createissue ...', shell=True)
print result.split("Created ",1)[1] 
Aleksey
  • 775
  • 5
  • 14