Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to attach a file in the report thanks to the CLA if I use a Python script ?

Hi everyone,

I am using the command line adapter of IBM to automate some process.

I put the python.exe (kernel) as the Command of the Adapter
And I put the Python script as the Argument.

Process works properly, but I am now trying to add a file to the Attachments in the Result Details. As I am not using a .bat or shell script, I did not find explanation on how to attach a file.

Has somebody the answer and could help me on how to attach a file thanks to a Python script?

Thanks,
Paul

0 votes


Accepted answer

Permanent link

My suggestion would be to write a basic batch file and  play with the feature first. See https://jazz.net/library/article/809 for how to attach files.


Once you understand the basics, call your python script from the command/batch file.

I experimented with this basic command batch:

echo Test
echo %*

set > c:\Temp\SetEnv.txt

echo SomeDocument=C:/shared/SomeDocument.txt >> %qm_AttachmentsFile%
echo SetEnv=c:/Temp/SetEnv.txt >> %qm_AttachmentsFile%
echo Jazz.net=https://jazz.net >> %qm_AttachmentsFile%
echo Google=https://google.com >> %qm_AttachmentsFile%

echo CustomAttributesFile is %qm_CustomAttributesFile% > c:\Temp\Files.txt
echo CustomPropertiesFile is %qm_CustomPropertiesFile% >> c:\Temp\Files.txt
echo ExecutionVariableFile is %qm_ExecutionVariablesFile% >> c:\Temp\Files.txt
echo AttachmentsFile is %qm_AttachmentsFile% >> c:\Temp\Files.txt
echo Files=c:/Temp/Files.txt >> %qm_AttachmentsFile%

Paul-Ambroise Burdet selected this answer as the correct answer

0 votes

Comments

This is what I was thinking to do

Thanks for your reply, I will give it a try!

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,939
× 13
× 10

Question asked: Sep 10 '20, 6:06 a.m.

Question was seen: 1,201 times

Last updated: Sep 14 '20, 1:35 a.m.

Confirmation Cancel Confirm