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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to get the IM details(what is the effort estimated and actual effort..etc) through command line

karthikPTCuser
7-Bedrock

How to get the IM details(what is the effort estimated and actual effort..etc) through command line

Hello,

I am writing a script, to get the IM details like,

1.what is the Overall hours estimation and overall actual effort

2.How to get the details of the software artifacts(in hours) what is the estimated effort at each level

like Requirements,design,code, unit test etc

 

4 REPLIES 4

It depends. Are you trying to retrieve existing field values or create a computed field? Is this a CLI or API script? Or is it a trigger?

 

To get a specific field value for an item, e.g. "Overall Hours Estimation":

           im issues --fields="Overall Hours Estimation" [item ID]

 

 

If you are creating a computed field:

 

For a field computation that adds other fields, just use "Field1" + "Field2" + "Field3" and so on. You can wrap this in the isEmpty() function to ensure no errors. So isEmpty("Field1" + "Field2" + "Field3",0).

 

If you want to aggregate from other items, there's a couple different options.

To count up all values of a field for items in a relationship field, use the aggregate function.

For example, to add all "Hours Estimation" for software artifacts linked through the "Project For" field: 

aggregate("Project For", sum("Hours Estimation"))

 

To count up all values of a field for items matching a query, use the Query or QueryCorrelated functions,

For example, if you want to add up "Estimated Effort" for all documents that have the same project field:

query("administrator:Active Documents", Project, sum("Estimated Effort"))

 

Note: documentation on computed expressions, including all functions, can be found in the online help, under Server Administration Calculations in Fields Charts and Reports > Computed Expression Function Classes

 

I am writing a script which executes at command line 

Trying to retrieve the existing fields.

Can i  retrieve any type of existing fields(Like Due Date under "Analysis" and Due date under "Implementation" from an IM?

1.When i execute the below command as suggested in the previous reply,

c:\users\username>im issues --fields="Overall Hours Estimation" [item ID] this gives me an 

*** MKS124814: Cannot show view information: MKS124066: Field "Overall Hours Estimation" does not exist.

 

2 As well i want to read the fields as attached in the snapshot?

The actual field name is sometimes different than what shows when viewing an item, as an admin can set a display name and also defined a different label for fields.

Double check for the actual names of your fields.

 

You can retrieve any field from an item. If you want more than one field in the same command, you can list multiple fields, e.g. im issues --fields="field 1","field 2","field 3" and so on. You can also view the entire item using im viewissue [item id]

Thanks for giving a hint with the command "im viewissue [item id]"

by looking at this command output, understood that the display name and background name is different.

I have written python code accordingly to achieve my task.

Announcements


Top Tags