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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

How do I set a field using the issue id?

bbean
8-Gravel

How do I set a field using the issue id?

When setting fields I generally use the db.setFieldValue(Field Name, Value). However, this only allows you to change the item that sparked the trigger as far as I know. I am looking for a method that would work like this:

var appID = db.getID();

db.setFieldValue(appID, Field Name, Value);


Where appID could potentially be any Issue Id, not just the issue the set off the trigger.

4 REPLIES 4
LLawton
14-Alexandrite
(To:bbean)

You use the method "getIssueBean" of "imServerBean" to get a specific item bean.

Look for sample scripts that use it, the simplest one being hello.js.

bbean
8-Gravel
(To:LLawton)

I know how to get values from the field using both

var docData = sb.getIssueBean(docID, ["Approvals"]);

and

var docData = sb.getIssueBean(docID);

However I want to be able to SET fields for issues. Do you know which method could be used to set fields using issue ID, field name, and new field value?

LLawton
14-Alexandrite
(To:bbean)

You're right, I read the question too quickly, sorry.

Use "getIssueDeltaBean" instead. You can see an example in emailAdvanced.

As   said,

var issueDeltaBean = sb.getIssueDeltaBean(IssueId);

issueDeltaBean.setFieldValue("FieldName", FieldValue);

Regards.

Top Tags