Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Send an Email Once when Parent is created

tracey.fudge June 15, 2023

I would like to send an email notification to the reporter once a parent task is created (for us that is a marketing campaign). 

 

The reporter is always a campaign manager on our team and the idea is in the email to include the 1) newly created campaign name (which is populated in the description field via other automation that is built) and 2) the link to the issue.

 

I have built other automation for emails, but for some reason this one is not working.  I am filtering for my name, so that I can test and not bother others :)

 

Screenshot 2023-06-15 at 10.04.03 AM.png

 

Screenshot 2023-06-15 at 10.08.03 AM.png

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
June 15, 2023

Hello @tracey.fudge 

In what way is the rule "not working"? What result are you expecting that you are not getting? What does the Audit Log say for execution of the rule?

Is the condition in this rule that checks the Campaign Name field dependent on the other rule that you mentioned?

1) newly created campaign name (which is populated in the description field via other automation that is built) 

If so then that other rule probably has not yet been triggered at the time that your rule for sending the email gets triggered.

tracey.fudge June 15, 2023

No email was sent - that is what I was expecting. I created a new issue with my name and that email was not sent to me.

Screenshot 2023-06-15 at 5.13.46 PM.png

Plus the email itself needs to include what is inside the field called Campaign Name, which I had not included previously.  Now it is included {{issue.CampaignName}}:

 

Screenshot 2023-06-15 at 5.12.52 PM.png

Trudy Claspill
Community Champion
June 15, 2023

What does the Audit Log say for execution of the rule?

What type of field is Campaign Name?

tracey.fudge June 15, 2023

Screenshot 2023-06-15 at 6.33.14 PM.png

tracey.fudge June 15, 2023

How do I know what type of field it is?  You mean type as in text?

tracey.fudge June 15, 2023

Screenshot 2023-06-15 at 6.35.25 PM.png

Trudy Claspill
Community Champion
June 15, 2023

Yes, that is what I meant. It is a text field (vs. a Dropdown field or a Labels field).

 

And what does the Audit Log say for execution of the rule?

Screen Shot 2023-06-15 at 3.43.59 PM.pngScreen Shot 2023-06-15 at 3.44.51 PM.pngScreen Shot 2023-06-15 at 3.45.15 PM.png

tracey.fudge June 16, 2023

Screenshot 2023-06-15 at 6.48.48 PM.png

tracey.fudge June 16, 2023

That is in the audit log

Trudy Claspill
Community Champion
June 16, 2023

Could you share the audit log information from the execution of the rule you originally posted - the one where you are trying to send the email?

tracey.fudge June 16, 2023

Screenshot 2023-06-16 at 11.19.21 AM.png

Trudy Claspill
Community Champion
June 16, 2023

Based on the audit log entries, the issues that are triggering the rule do not have the value "tracey" in the Campaign Name field at the time the issue is created.

How is the Campaign Name field being filled in? Is it filled in by the user manually during creation? Is it filled in by a Post Function in the Create transition in the workflow?

tracey.fudge June 19, 2023

Ok let me check this again.

tracey.fudge June 19, 2023

Screenshot 2023-06-19 at 8.18.22 AM.pngScreenshot 2023-06-19 at 8.16.53 AM.png

I just created another campaign with tracey in the name. See bottom image.  When I look at the audit log, it did not run.

Trudy Claspill
Community Champion
June 19, 2023

This is puzzling.

It appears that you are working with issues in a Team Managed project. You can confirm that by checking the bottom of the panel on the left when viewing the project. It will say there either "team-managed" or "company-managed".

 

Can you confirm that you are entering the text "GL-WB-20230623--tracey-june-19-test" into the Campaign Name field in the Create Issue dialog? It wasn't added later by another automation rule?

Can you show us the details of the Condition step in the Automation Rule?

Can you add a step before the Condition that uses a Log Action to print out the Campaign Name value into the Audit Log?

Screen Shot 2023-06-19 at 10.31.06 AM.png

I tried the same sort of condition and used the same example text, and my rule said the created issue matched the condition.

 

Sometimes when a rule has been edited many times something can get inexplicable corrupted in the rule but that corruption is not visible when you look at the rule.

Can you try making a new rule from scratch with the same steps? Disable the first rule, then create an issue with the matching text and see if the new rule sends the message.

tracey.fudge June 20, 2023

My responses below in BOLD: 

It appears that you are working with issues in a Team Managed project. You can confirm that by checking the bottom of the panel on the left when viewing the project. It will say there either "team-managed" or "company-managed".

YES this is team managed

Can you confirm that you are entering the text "GL-WB-20230623--tracey-june-19-test" into the Campaign Name field in the Create Issue dialog? It wasn't added later by another automation rule?  

The campaign name is auto generated to concatenate what is entered into the form intake and adds other elements to produce a campaign name.  

the automation rule looks like this.  An the campaign name is generated by this code:  

{{issue.customfield_12271.value.substringBefore("-")}}-WB-{{issue.customfield_12406.format("YYYYMMdd")}}--{{issue.Summary}}

Screenshot 2023-06-19 at 2.01.35 PM.png

So I added the email to this step and in the email I thought this that "campaign name" was some custom field, so I add that custom field to the email and that is not the name of "Campaign Name".  How do I know what field that is?

 

Screenshot 2023-06-20 at 7.15.23 AM.png

Trudy Claspill
Community Champion
June 20, 2023

Hello @tracey.fudge 

I'd like to get some clarification on your issue.

You started the post asking about a rule to send an email based on a field containing certain text. That rule was failing to send the email and you asked why the email was not sent.

In your last response you have shown a different rule, still triggered by issue creation, but instead of checking the field for a value and sending an email this rule is editing the same field and sending an email. And now I think you question is how to add the Campaign Name field value to the email. Is that correct?

If so you should be able to reference that field data with {{issue.Campaign Name}} or the customfield_##### ID for the field. However, since you edit the same field just before you try to send the email you should insert a Re-fetch issue data action between the Edit and Send email actions to ensure you have the current data for the issue.

tracey.fudge June 22, 2023

Trudy - THANK YOU.  Yes this worked.  I had an epiphany mid way through this ticket, so that is why I switched up the logic and associated examples.  Initially, I was making this more complicated than it needed to be.  You're awesome!!!

Like Trudy Claspill likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events