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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Get Issue Field value by CLI (supporting line breaks)

tdalon
12-Amethyst

Get Issue Field value by CLI (supporting line breaks)

Hello

I am looking for CLI solution how to get an issue field value with the field being a text with linebreaks. (example Requirement Text field).

I've started parsing the im viewissue output but it is difficult to split between fields and field values.

See example below:

-----------------------------

t =

Type: Requirement

ID: 187581

Created By: Miller Christian RGB (MILLERC)

Created Date: Sep 14, 2012 1:57:20 PM

Modified By: Wenger Gregor RGB (WENGERG)

Modified Date: Oct 17, 2012 1:45:41 PM

State: New

Project: /PSL/CmbEng/EngOperSt/CA000

Contains:

Contained By: 187542

References: 187582xyz

Reference Mode: Author

Root ID: 187581

Input Revision Date: Oct 17, 2012 1:45:41 PM

Document ID: 187541

Subsegment Name:

Referenced Item Type: Shared Requirement

Category: Functional Requirement

Shares:

Shared By:

Revision Date: Oct 17, 2012 1:45:41 PM

Authorizing Change Order:

Suspect Count: 0

Valid Change Order: true

IncludeReference: false

Discussion:

Priority:

Changes Authorized By:

Decomposes To:

Decomposed From:

Is Related To:

Is Related Back:

Text: The time after start (EOS_TiElpdAftStrt) shall be realized with an integrator. If EOS_AcvStrtEnd = 1 shall be count. The integrator shall be set on reset when EOS_AcvStrtEnd = 0.

The time after stop (EOS_TiElpdAftStop) shall be realized with an integrator. If EOS_AcvStop = 1 shall be count. When the signal of EOS_AcvStop rise shall the integrator set on reset.

Text Attachments:

Project Phase:

Trace Status: none

Downstream Trace Count: 0

Upstream Trace Count: 0

Linked Requests:

Requirement Tested By:

Related Development Tasks:

RIF_Attachments:

RIF_Configuration:

RIF_Identifier: d9b7ff3e-b91f-4eb2-9ed3-48780df07860

RIF_ID: 723951712

Requirement Origin:

Requirement Level:

Requirement Safety Standard:

Requirement Safety Levels:

Requirement Rationale:

RIF_Attachments_fva:

Requirement Acceptance Criteria:

Discussed in:

Requirement Summary:

Planned for:

Stakeholder Comment:

Referenced Bookmarks:

Bookmarks:

Reuse Potential:

Approval Customer: clarify

Approval Supplier:

Comment Customer:

Comment Supplier:

System Level:

System Structure Nodes:

Decomposition Summary:

Item Significant Edit Date on Shared Item: Oct 17, 2012 1:45:41 PM

Significant Edit Date: Oct 17, 2012 1:45:41 PM

Stakeholder ID:

RIF_Additional_Info_txt:

RIF_Additional_Info_int:

Attachments:

Forward Relationships:

Backward Relationships:

-------------------

In bold I've marked the output of the Text field.

It is specially difficult if in my requirement text I have line breaks or : sign used.

I was hoping the im viewissue would support a --field="Text" option like for the im issues (query) but it seems not the case.

So the current solution I have now is in two steps:

Getting the list of all fields by a im viewissue --xmlapi and then parsing the ouput for <Field name="([^<]*)">'.

Knowing the output list of fields, parsing the output of the im viewissue to look for value between Field and the next neighbouring field in the list.

Any better idea?

Many thanks

Kind regards

ACCEPTED SOLUTION

Accepted Solutions

Hi Thierry,

Try im issues --fields=Text <<itemID>> where <<itemID>> is replaced with the ID of the item you want to parse.

Note that im issues also has a --fieldsDelim argument, that might help when parsing multiple fields in one pass.

Regards,

Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager

View solution in original post

5 REPLIES 5

Hi Thierry,

Try im issues --fields=Text <<itemID>> where <<itemID>> is replaced with the ID of the item you want to parse.

Note that im issues also has a --fieldsDelim argument, that might help when parsing multiple fields in one pass.

Regards,

Kael


Kind Regards,
Kael Lizak

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

Thank you Michael! Perfect answer - also with the hint for the --fieldsDelim option.

tdalon
12-Amethyst
(To:tdalon)

Another solution is to export the items to an excel file (using im exportissues) and read the output Excel file.

This is much better if you want to read multiple items in one pass.

jsummers
11-Garnet
(To:tdalon)

Export+to+Excel.PNGWhy wouldn't you use the export to excel function from WEB Client view right click using the menu option as shown in the screen shot attached, you can add all the fields to your view screen to export.

tdalon
12-Amethyst
(To:jsummers)

The question was how to get the field values by script/ command line.

Announcements


Top Tags