Hello
I have a behaviour which should set the reporter of a sub-task to the assignee of the parent task.
Here's an extract of my script.
FormField parent = getFieldById("parentIssueId")
Long parentIssueId = parent.getFormValue() as Long
def parentIssue = issueManager.getIssueObject(parentIssueId)
def parentIssueAssignee = parentIssue.assigneeId
def subTaskReporter = getFieldById(REPORTER)
subTaskReporter.setFormValue(parentIssueAssignee)
subTaskReporter.setReadOnly(true)
However, the reporter remains the same as the current user.
When I hardcode the reporter to for example "svc_jirabot", it works.
subTaskReporter.setFormValue("svc_jirabot")
The assignee ID gets retrieved successfully so I don't know what's the issue here. Here's an extract of my debug log
[c.o.j.groovy.user.FieldBehaviours] --------------------This is to test Behaviours Logging----------------
[c.o.j.groovy.user.FieldBehaviours] svc_jirabot
Any Ideas?
BR
Marius
Hello @[deleted]
Instead of using Behaviour for this, why don't you implement this change in the post-function of the create transition of the sub-task.
The kind of requirement which you have is easier to implement using the backend API instead of behaviour.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would like the user to be able to see what is being set right on the create issue screen. It enhances usability in my opinion.
I have never worked with the backend API and as I'm really close to getting it, I don't think it would be the easier aproach. Scriptrunner ist just bugging out here idk
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.