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:
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]