Write email to user in customfield

Christopher Dick January 5, 2023

Hello there,

Unfortunately it is not possible for me to select a customfield as recipient of an email.

I tried the following values as the recipient of the email without success: {{customfield_11520}}, {{customfield_11520.value}}, {{issue.customfield_11520}}, {{issue.customfield_11520.value}}

Before that I check with an extended comparison condition (^null$|^$) if the field {{issue.customfield_11520}} ("Testauftraggeber") is not empty.

Error message:
Send email
The email could not be sent because the "To" field is empty. If you referenced a field, it may be empty.

 

Screenshot: Automation

2023-01-06 08_23_17-Email notification to issue creator (project A) af....png

Screenshot: Customfield

2023-01-06 08_34_11-Testmanagement (_) - Vorgangstypen - JIRA.png

Many Greetings,

Christopher

1 answer

1 accepted

1 vote
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 5, 2023

Hi @Christopher Dick 

Try simply with {issue.CUSTOMFIELDNAME}}. E.g. I have a paragraph field called "Paragraph". To get the value of this text field I used {{issue.Paragraph}} and the send email worked just fine. What type of field is your field?

send email.png

Christopher Dick January 6, 2023

Hi Alex,

Unfortunately, that didn't work out.

I still get the same error message that the field is empty.

I have already removed the comparison condition.

In my first post you can see a screenshot of the field.

Please see also screenshot:

2023-01-06 09_10_27-.png

Christopher Dick January 6, 2023

The custom field contains a user from another project.

That means there is a manual trigger in project A and the triggering user creates a new task in project B. The new task contains a custom field to store the triggering user.

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 6, 2023

@Christopher Dick 

The field you are using is a user picker field. Meaning that behind it Jira uses the account id of the user and not any other information. To acquire this type:

{{issue.Testauftraggeber.emailAddress}}
Christopher Dick January 6, 2023

Unfortunately, that didn't work out.

I still get the same error message that the field is empty.

Christopher Dick January 6, 2023

When copying from project A to project B, can't I pass the email address of the user who is firing the trigger into a new text field?

Unfortunately, the text field remained empty in the following attempt:

{
"fields": {
"customfield_11520": [{"id": "{{initiator.accountID}}" }],
"customfield_11523": [{"id": "{{initiator.emailAdress}}" }]
}
}

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 6, 2023

@Christopher Dick can you explain/break down your rule please? It doesn't make any sense not to work the above smart value I gave you. I mean I tested it and I have successfully received the email. The only thing I can think of, is that this user field is being copied after the email has been sent. Soo... try adding a re-fetch component before sending the email.

Christopher Dick January 6, 2023

I found a spelling error, but the problem still persists:

{
"fields": {
"customfield_11520": [{"id": "{{initiator.accountID}}" }],
"customfield_11523": [{"id": "{{initiator.emailAddress}}" }]
}
}

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 6, 2023

"customfield_11523": [{"id": "{{initiator.emailAddress}}" }]

You are trying to add an email address to an id. This can't happen :)

Like Christopher Dick likes this
Christopher Dick January 6, 2023

I am unfortunately still new to the topic.

How can I pass the email into a text field?

By the way, the email cannot be sent even after refreshing the process again. Furthermore, an empty field is mentioned as an error.

2023-01-06 09_57_01-Einstellungen - JIRA.png

Christopher Dick January 6, 2023

Both rules at a glance.

On the left, Project B for sending e-mails.

Right Project A for creating a new task in Project B.

2023-01-06 09_58_25-.png

Christopher Dick January 6, 2023

Thanks now everything works :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events