Using JETI through Post Function Workflow

Hi

I'm trying to send an email as a Post Function using JETI. The recipents are in a JIRA Group which is in a custom field called Reviewers. See below.



I'm the only member of the group and I'm not recieving the email. I know email is working fine, I've tested sending an email to single user in a custom field and it works Ok.

Can you send emails to Group which are populated in a custom field ? Any ideas ?

1 answer

1 accepted

This widget could not be displayed.

Have you got "email me on my changes" enabled in your profile?

Yes, my profile is set to "Notify me" for my changes.

In addition the Reviewers custom field is generated by using the Behaviours Plugin -

FormField ap = getFieldById(getFieldChanged())
FormField reviewers = getFieldByName ("Reviewers")

String approvals_process = ap.getValue()

log.debug "Approval Process....." + approvals_process

if (approvals_process == "TAS") {
reviewers.setFormValue("cmc-tas-level-one-approvers")
}
else if (approvals_process == "SAS") {
reviewers.setFormValue("cmc-sas-level-one-approvers")
}
else if (approvals_process == "EUS") {
reviewers.setFormValue("cmc-eus-level-one-approvers")
}
else {
reviewers.setFormValue("cmc-dba-level-one-approvers")
}

Oh, hang on, that could explain it.

As far as I can tell, JETI can use either a "user" field to send email to, a "group" field, or a raw email address as text. But you've told it to use a "scripted" field. So, I think JETI is getting a string from the field and ignoring it beause it's not a valid email, a user or a group.

I am guessing here - your log might tell you more.

I thought that might be the case.

Any ideas how you script a Group field ?

I don't think you can directly - the *type* of a field is determined by the code in the plugin providing it - in this case, the script runner does not announce a scripted field as containing anything other than "results of a script"

I suspect the best you can do is bin the scripted field, replace it with a group field, then take the code you were using in the scripted field and move it into a listener that will populate the group field appropriately

Thanks for the advice. That worked !

Cheers

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

281 views 5 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you