Hi,
I have checkbox named 'Control Release' checkbox and I want to make this field enable for user who is in 'Control Release Owner' field on certain workflow statuses.
How to do that?
Any help would be appreciated..
Hi @Teja,
So, the users, except the control release owner, will see the control release cf as read-only.
Tansu Akdeniz
@Tansu Akdeniz
So the "Control Release" [checkbox], will always available to "Control Release Owner".
May be I was not clear, I will explain with the example.
When the issue in 'Created' , 'Requested' status "Control Release" [checkbox] should always be disabled include "Control Release Owner" and when the issue in 'Control Release' status, then "Control Release" [checkbox] enabled for "Control Release Owner" only.
Hi @Teja
You can add a groovy code in behaviours section like this;
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.issue.Issue;import com.atlassian.jira.issue.fields.CustomField;import com.atlassian.jira.issue.CustomFieldManager;import com.atlassian.jira.user.ApplicationUser;def issueId = getFieldById("id")def controlReleaseCheckbox = getFieldById(getFieldChanged()); def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()def customFieldManager = ComponentAccessor.getCustomFieldManager();Issue issue = ComponentAccessor.getIssueManager().getIssueObject(issueId.getValue() as Long);String currentUserName = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser().getName();CustomField controlReleaseUserCF = customFieldManager.getCustomFieldObject("customfield_10136");def controlReleaseUser = issue.getCustomFieldValue(controlReleaseUserCF);if(issue.getStatusId().equals("12345")){ //Control Release Status if(currentUserName.equals(controlReleaseUser.getName())){ controlReleaseCheckbox.setReadOnly(false) } else{ controlReleaseCheckbox.setReadOnly(true) }} else{ controlReleaseCheckbox.setReadOnly(true)}
Tansu
Hi @Tansu Akdeniz,
Thanks for you script.
I tried this in fields server-side script but I am getting error and not working as expected.
I shared screen shot.
And why are we using particular issueid instead of issue?
Glad to hear that. You are welcome @Teja
It looks like you're new here. Sign in or register to get started.