Hi Everyone,
I am trying to implement service desk in my Organization, Based on the requirements, I need to update a custom field (either text field or single select) based on the service desk customer of that project.
for example: if a person with email's (abc@def.com) or raise a ticket from customer portal then the custom filed "company"must update with "DEF"
I am thinking that script runner might have a solution for this.
I have very less knowledge on groovy scripting.
Hi,
The ScriptRunner documentation site has an article about Service Desk which describes how to do something very similar to what you want. If you're not interested in the fancy links etc. then here's a step-by-step approach:
issue.reporter?.emailAddress?.replaceAll(/.*@/, "")
One thing to note here is that the script will give you the entire domain name of the company (i.e. everything after the @ sign in the email address). For example, the email address "employee@company.co.uk" would produce a result of "company.co.uk". If you'd rather just have the first part of the domain name (i.e. everything between the @ sign and the first dot) then you can replace the above script with the following:
issue.reporter?.emailAddress?.replaceAll(/.*@/, "").replaceAll(/\..*/, "")
In this case, "employee@company.co.uk" would give the result "company".
Hope this is of some use!
Yours,
Jake
Hi Jake,
Thank you for your response, this works perfectly.
I have another question,
Lets say I have custom file with single select option with 50 options, is there any way that based on the domain an option should be populated automatically can we use if else functionality or something like that?
Thank you for your time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anudeep,
I'd be happy to try and answer your follow-up question, although I would recommend that you post it as a new question in Community, so that users in future will be able to find it more easily.
When you post your question, if you would be able to specify the following things, then that would be helpful for me in determining the most appropriate solution:
Thanks.
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.