in src/Common/ProcessImporter.ts [446:465]
private async _importWITRule(rule: WITProcessInterfaces.FieldRuleModel, witRulesEntry: IWITRules, payload: IProcessPayload) {
try {
const createdRule = await Engine.Task(
() => this._witProcessApi.addWorkItemTypeRule(rule, payload.process.typeId, witRulesEntry.workItemTypeRefName),
`Create rule '${rule.id}' in work item type '${witRulesEntry.workItemTypeRefName}'`);
if (!createdRule || !createdRule.id) {
throw new ImportError(`Unable to create rule '${rule.id}' in work item type '${witRulesEntry.workItemTypeRefName}', server returned empty result or id.`);
}
}
catch (error) {
if (this._config.options.continueOnRuleImportFailure === true) {
logger.logWarning(`Failed to import rule below, continue importing rest of process.\r\n:Error:${error}\r\n${JSON.stringify(rule, null, 2)}`);
}
else {
Utility.handleKnownError(error);
throw new ImportError(`Unable to create rule '${rule.id}' in work item type '${witRulesEntry.workItemTypeRefName}', see logs for details.`);
}
}
}