Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,013
Community Members
 
Community Events
184
Community Groups

Send email by script runner CLOUD

Edited
Eduard Diez
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Aug 08, 2018

Morning;

 

I need send a mail in CLOUD, always in CLOUD please.

I need send a mail in the roles group, when I do a action in service desk. 

Is possible to send a mail in CLOUD whit groovy? Cause I try to do, and for me is very complicated and Im new in this world.

 

Thank's

3 answers

1 accepted

1 vote
Answer accepted
Neta Elyakim
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Aug 14, 2018

You can use this :

def resp = post("/rest/api/2/issue/${issueKey}/notify")
.header("Content-Type", "application/json")
.body([
subject: 'Mail title',
textBody: "Body",
htmlBody: "<p>Body</p>",
to: [
users: [[
name: "username",
active: true
]]
groups: [[
name: 'some group'
]]
]
])
.asString()

Please note that you can send an email to jira group(groups) or jira user (users), but please note that you can't get the email if you are the sender.

You can see the example in scriptRunner docs- 

http://scriptrunner-docs.connect.adaptavist.com/jiracloud/script-listeners.html#_store_subtask_estimates_in_parent_issue_on_issue_events

And another community question regarding this subject (my question)

https://community.atlassian.com/t5/Adaptavist-questions/Notify-rest-with-ScriptRunner-for-Jira-cloud-is-not-working/qaq-p/793509 

Eduard Diez
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Aug 14, 2018 • edited Sep 21, 2018

I'ts great, thank's, for groups it's fantastic, But I don't have problems except that I need put the group with quotation marks 'group', Do you know why?

 

And for users I have some problems, Can I do another question? .Is possible that some users, don't send the notification? When all users have mail in their profile. My code is this:

 

def user= currentUsername //if is scaled put current user
logger.info('usuario-->'+user)
//send mail a user
def resp = post("/rest/api/2/issue/${issueKey}/notify")
            .header("Content-Type", "application/json")
            .body([
subject: 'Tiene asignada como agente de N2 la Issue - '+ issueKey +' como Grupo Nivel 2',
textBody: "Body",
htmlBody: "<p>Se le asigna a "+user+" grupo N2 esta Issue</p>",
               to: [
                    users: [[
                               name: user, //I have problems in this point, cause don't send when I put user, but if I pur the user like 'admin', it send a mail without problems
                    active: true
                               ]]
                    ]
                ])
.asString()
bol = true
logger.info('usuario-->'+user)

Se puede enviar a varios usuarios definidos? No son del mismo grupo, sino algo así como:

users: [[

             name: User 1,

             active: true
           ],

           [

             name: User 2,

             active: true
           ]

]

Hi @Eduard Diez 

 

Im am trying to write a scriptrunner script for jira cloud that sends custom email.

 

Can you help me with this?

como sumar dos campos en cloud

Eduard Diez
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Dec 16, 2018

No te entiendo? quieres sumar dos campos en cloud? o que pides?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events