hi all
in the create issue screen there is a field as Watchers, I want to update this field even if the user didn't do it in the creating step. I used following script in scriptrunner post function so that add "b-atb" user to Watcher list :
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.MutableIssue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
MutableIssue issue = issue as MutableIssue
def myField = customFieldManager.getCustomFieldObjectByName("Watchers")
issue.setCustomFieldValue(myField,'b-atb')
but after publishing, when i tried to create an issue, following message has been shown in the create screen:
We can't create this issue for you right now, it could be due to unsupported content you've entered into one or more of the issue fields. If this situation persists, contact your administrator as they'll be able to access more specific information in the log file.
any advise will be so appreciated