Created
April 24, 2015 15:01
-
-
Save pupca/faac32485c33c0149d14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var wi = workflowContext.getWorkItem(); | |
var toField = arguments.getAsString("toField"); | |
function log(msg) { | |
print("popelakm_log : " + msg + "\n") | |
// tail -f /var/log/polarion/polarion.log | grep popelakm_log | |
} | |
if (wi.getCustomField(toField) == null) { | |
var user = wi.getDataSvc().searchInstances("User", "id:" + wi.getDataSvc().getSecurityService().getCurrentUser(), "id").get(0) | |
var type = wi.getCustomFieldPrototype(toField).getType() | |
var enumFactory = wi.getDataSvc().getObjectEnumerationForEnumId(type, wi.getContextId()) | |
wi.setCustomField(toField, enumFactory.wrapObject(user)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment