cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Get IssueId when creating issue from command line

akuruvila
12-Amethyst

Get IssueId when creating issue from command line

Hi Team,

I'm using batch file to create new issues ( im createissue) based on certain conditions. Is there any way i can get the ID of newly created item using the same batch file ?

Regards,

Arun

ACCEPTED SOLUTION

Accepted Solutions

Hi Arun,

I am not sure whether using the --gui option gives you a result on the command line at all, as you'll get the visual feedback.

Without the --gui option your command should result in something like:

Modifying item ...

Editing fields ...

Submitting ...

Updated item <# ITEM_ID# >

View solution in original post

11 REPLIES 11

usually the new Item'S ID is the result value of a CLI "im createIssue .... " command.

Depending on the Integrity Version you are using, this result is either streamed out on STDIO or STDERR.

So you might have to check both and parse the result.

akuruvila
12-Amethyst
(To:mrump)

Thanks for the reply Matthias.

I was trying to capture STDIO / STDERR using below command - but got empty log file.Could you help.


im editissue --Field='Description=%DESCRIPTION%' --gui %ITEM_ID% 1>D:/Integrity/log1.txt 2>&1

**I'm able to get logs for viewissue commands.

Regards,

Arun

Hi Arun,

I am not sure whether using the --gui option gives you a result on the command line at all, as you'll get the visual feedback.

Without the --gui option your command should result in something like:

Modifying item ...

Editing fields ...

Submitting ...

Updated item <# ITEM_ID# >

akuruvila
12-Amethyst
(To:mrump)

Thanks for the reply.

I was expecting Integrity tool to return some value after submitting the new Issue using --gui.

Even parsing from a log file (in Integrity Client machine) will do for me

Regards,

Arun

Hi Arun,

Could you mark which of Matthias' responses helped you resolve this issue? You can hit the Correct Answer button for the post that most closely resolved the issue and you can mark any post which also helped as Helpful by clicking on the Actions button at the bottom of a post and selecting Mark as Helpful.

The benefit of this is that if someone comes by this later, they can see what helped you get a resolution to your issue, and it also recognizes Matthias' contribution to helping you with this issue.

On a related note, if you feel that using the --gui flag should not prevent the item ID from being dumped to STDERR, you can open up a case with PTC Integrity Lifecycle Manager Support to have this added as a feature.

Regards,

Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager

Thanks Arun!


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
tdalon
12-Amethyst
(To:akuruvila)

Hi Arun,

you can use the --xmlapi flag and parse their the command output to extract the IssueID.

HTH

Thierry

akuruvila
12-Amethyst
(To:tdalon)

Thanks for the reply Thierry.

--xmlapi also not giving any output when used with --gui.

Regards,

Arun

tdalon
12-Amethyst
(To:akuruvila)

Hi Arun

ok. maybe it work for you to first to create the Issue without --gui and then open it with 'im editissue --gui IssueID'?

or you want the possibility to cancel the issue creation?

Regards

Thierry

You could try the --displayIdOnly option. This has the effect you want of printing the ID of the newly created item. Using Korn you can do something like

co2=$(im createissue --type="Change Order" <<fields>> --displayIdOnly 2>&1)

print "Created Change Order issue $co2 and saved ID" >>deploy.log

akuruvila
12-Amethyst
(To:pbowden)

Still getting same issue.

displayIdOnly not returning any value when used with --gui.


Regards,

Arun

Announcements


Top Tags