Set component based on e-mailadress the request was sent to
Asked by Johan Bergstr?m:

I'm really a beginner when it comes to Jira Service in general and automation specifically, so bare with me.

What I understand my question is probably simple but here goes:

I want to set component (and other parameters too but I'll just copy this one) based on e-mail address that was used by the person sending a request. So not from e-mail address.

How do I do this?

The workflows and issue types for our Jira service project are all standard.

/Johan


Answers:
author: Mark Segall
body: Hi [@Johan Bergstr?m](/t5/user/viewprofilepage/user-id/4621448) - Can you please clarify a couple things?

* **The person sending a request** - Do you mean the **Reporter**?
* **Desired Component value** - Using the example email address (jsmith@example.com), are you looking for it to be:
  * Entire email address (jsmith@example.com)
  * Second Level Domain (SLD) and Top Level Domain (TLD) (example.com)
  * Just the SLD (example)
  * Just the mailbox (jsmith)
* **Most importantly, are the components already created?** If not, automation does not provide a mechanism for creating new components. In this scenario, you may want to explore labels instead, but we can cross that bridge once we have a better understanding of your end goal.

comments: author: Johan Bergstr?m
body: Hi!

1. Yes - Reporter
2. The entire email address
3. Yes, they are created

/Johan


author: Mark Segall
body: Ok - This should be straightforward then. You want something like this in its simplest form:

* TRIGGER: Issue Created
* ACTION: Log Action (This is a helpful step just to make sure we're capturing the right data)
  * {{issue.reporter.emailAddress}}
* ACTION: Edit Issue (Component)
  * {{issue.reporter.emailAddress}}


author: Johan Bergstr?m
body: I'm sorry but I need a bit more help I think.

My case:

* Email request is sent
  * If to: email address Is Equal to company@support.domain.com Then
    * Set specific Component

The key trigger is the email address **to:**company@support.domain.com, not from:email address

The scenario is to set different components depending on different to:email addresses. We want to set up unique email addresses for different customers that sets different components/labels.

FYI, did get the automation to work except I didn't know how to use {{issue.reporter.emailAddress}} in

*
  > ACTION: Edit Issue (Component)
  *
    > {{issue.reporter.emailAddress}}


author: Mark Segall
body: So you're looking for an incoming address? Meaning... You're at company xyz. You've set up multiple options for emailing (e.g. email1@xyz.com, email2@xyz.com, email3@xyz.com) and they all create issues on this project. Is this correct?

If this is the case, you're not going to be able to parse that information that I'm aware of. Your best solution would be to tie each email address to a unique issue type so that you could automate or query against the issue type with knowledge that it was sent to the desired email. Does this make sense?


author: Johan Bergstr?m
body: Yes, that's correct.

Yes, I understand. I only have to figure out how to create unique issue types. Any hints on that...?


author: Johan Bergstr?m
body: And how do I tie the unique email address to my unique issue type?


author: Mark Segall
body: As a Jira Admin, you can create new issue types under **Settings** \>\> **Issues** \>\> **Issue Types**.

You would also need to set up email handlers for this which is not really my strength. Are you on server or cloud?


author: Johan Bergstr?m
body: Cloud


author: Mark Segall
body: So after your issue types are created, you'd set up the email handler here:

```
https://YOURINSTANCE.atlassian.net/secure/admin/IncomingMailServers.jspa
```