Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Send email when was assigned by automated rule


Hello, could you support me with this use case? In my Jira instance, in the notification scheme, we have configured in Email Notification Preferenses send an email when "the issue is assigned to you" and this works ok, but when including a post function in workflow that automatically assigns the card, the person who has been assigned does not receive the mail. Can someone give me clarity why does this happen?

1 answer

Hi @Daniela Buffarini 

I think your problem with the order , Can you please check the order of your post-function and be sure that it is before firing  issue event


Hi @Mohamed Adel OrderInPostFunction.PNG Thanks for your help, I add a screenshot to see the order; I understand that the execution rule that I automate happens first. In what order should it be executed so that it then executes the action of notifying the assigned users?

@Daniela Buffarini 

Now the problem is that you are trying to assign your issue but the fired issue event is Generic Event and this is not the one you configured your notification scheme for as you configured "Issue Assigned" Event , try to add your assignee script after firing the Generic Event and let's see how this work 


Thanks again @Mohamed Adel . I followed your advice and changed the configuration in this way, but still the notification scheme did not send the mailOrderInPostFunction2.PNG

@Daniela Buffarini  good, now let's check your code how you are setting the assignee can you share your custom script 

Yes.  This the code and assign the user correctly

OrderInPostFunction3.PNG

Text: 

import com.atlassian.jira.component.ComponentAccessor

def userManager = ComponentAccessor.userManager
def someUser = userManager.getUserByKey("xxxxxxx")
issue.assignee = someUser

ok , update your script to be like the one in this thread 

 

https://community.atlassian.com/t5/Jira-questions/Updating-assignee-via-scriptrunner/qaq-p/637155

 

import com.atlassian.jira.component.ComponentAccessor

def issueService = ComponentAccessor.getIssueService()
def userManager = ComponentAccessor.getUserManager()

def user = userManager.getUserByName("tbas")


def validateAssignResult = issueService.validateAssign(user, issue.id, issue.reporterId)
issueService.assign(user, validateAssignResult)
Like Daniela Buffarini likes this

also, move your assignee script order to be before the Generic event ,the ordering is not the issue now

Like Daniela Buffarini likes this

OrderInPostFunction4.PNG
Now with this code I try again, but it does not make the change to assign the new user. Assigne remains unchanged. If it was Unassigned, it remains unchanged. Test in both circumstances, with the rule before General Events and with the rule after General Events with the same result. It does not update in assigne. I can not understand how to achieve the assignment and the sending of mail. Coud you keep helping me @Mohamed Adel 

@Daniela Buffarini  is there any error in the script history log?

OrderInPostFunction7.PNG


This is how notifications are configured for the project, just in case

What is the configuration on issue assigned event ?

OrderInPostFunction8.PNG


It is exactly the same as generic event

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

322 views 9 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you