Hi All,
I have a script in place which should change the reporter after the creation phase (post-function). The source of the new reporter is a single-user-picker. The idea is, as soon as somebody creates a ticket for someone else I want that the "someone else" will be set as the new reporter. I am using JIRA 7.8.0 with JIRA SD 3.11 and cant find my mistake.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
MutableIssue issue = issue
def onBehalfOfCustomField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("ASD: On behalf of")
def onBehalfOfValue = issue.getCustomFieldValue(onBehalfOfCustomField)
if (onBehalfOfValue){
issue.setReporter(onBehalfOfValue)
}
Best,
Kristian
Hi,
I'm using Jira 7.3.3 Jira SD 3.4.0
When someone create a ticket (from customer portal) on behalf of someone else.
That someone else is automatically the reporter (no need for script or something).
Hi Nir,
Would you please explain me your environment? Our customers need to login first before they are able to create tickets. Means the system choose them as a default reporter each time as soon they create a ticket.
It was necessary to create custom fields and add this fields to each request type. I am curious how your environment looks like.
Best,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I understand the issue now.
I meant for the option that exist here:
As admin, you can create ticket on behalf of someone (built in in JSD).
But you want the customers to have this feature, so you created a custom field and you are trying to use a script on it.
Well, what the script logs says?
Did it pass successfully and just did nothing or it fails?
If it fails, what are the errors?
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.
Hi Kristian,
Can you share what you did?
What did you change to make it work now?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created a custom field. As soon this field is not null the value will be set as a new reporter. The sweet part of it is, that a user could raise a ticket for an colleague without getting any notificaiton.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.issue.MutableIssue
MutableIssue issue = issue
def customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("ASD: On behalf of")
def newReporter = issue.getCustomFieldValue(customField) as ApplicationUser
if (customField){
issue.setReporter(newReporter)
}
issue.store()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah,
So you were only missing the
issue.store();
Thanks for sharing :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.