Hi Team,
Once the user selects Jira project in jira project picker field and then the approver field will be going to set by the Project lead which is happening by the restAPI, but now days the ticket is created without adding the approver and which is mandatory this is happening only for few tickets, Can you please help us in providing the solution for this.
Thanks,
Sravan kumar.
Hi @Sravan kumar and welcome,
please could you provide post function information that put Approver on ticket creation?
Fabio
Hi @Fabio Racobaldo _Catworkx_ ,
Thank you so much for supporting on this request.
Please find the script
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Sravan kumar ,
this seems to be a behaviour and not a post function (please confirm). If so and Approvers is a single user picker try the following code
def approverfield = getFieldByName('Approvers')
def projectField = getFieldById(getFieldChanged())
def project = projectField.getValue();
String projectKey = project!=null?project.toString().replaceAll("Project: ",""):null;
if(projectKey!=null){
ApplicationUser leadvalue = ComponentAccessor.getProjectManager().getProjectObjByKey(projectKey).getLead();
approverfield.setFormValue(leadvalue);
approverfield.setReadOnly(true);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.