I have a Javascript transformation I’m working on in sandbox working with Jira Assets. Some Asset IDs are different between my Jira Sandbox and Jira Production. I’m trying to see if there is a way to distinguish which Celigo environment I’m in so I can pass through the correct values if it’s running in sandbox or prod. Right now I’m doing this via an environment variable that is set manually, but wanted to see if there was a way to tell automatically via some type of helper function.
See below for what I’m trying to accomplish:
function transform(options) {
const record = options.record;
const environment = 'sandbox';
const prodWorkspaceId = "0a12b3c4-56d7-8901-e2fg-3hijklm4n56p";
const sbxWorkspaceId = "9z87yx6w-vu5t-4321-09s8-76r54qp3210n";
const workspaceId = environment === 'sandbox' ? sbxWorkspaceId : prodWorkspaceId;const customfield_10117 =[ ];
if (record.Has_Boolean__c) {
const objectId = environment === 'sandbox' ? "4451593" : "4604317";
customfield_10117.push({
"workspaceId": workspaceId,
"id":${workspaceId}:${objectId},
"objectId": objectId
});
}record.customfield_10117 = customfield_10117;
}
