Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

Scriptrunner : Send Notification Post Function

Edited

Hi I encountered this error when using the Send Notification post function. Please advise. Thank you

2018-10-08 09:00:08.382 INFO - Serializing object into 'interface java.util.List'
2018-10-08 09:00:08.740 INFO - GET /rest/api/2/field asObject Request Duration: 2775ms
2018-10-08 09:00:08.881 ERROR - Cannot get property 'id' on null object on line 5
2018-10-08 09:00:08.906 ERROR - Class: com.adaptavist.sr.cloud.workflow.SendNotification, Config: [className:com.adaptavist.sr.cloud.workflow.SendNotification, uuid:1512ed34-ee27-49ce-9c22-601c21ad5ca2, description:Send email to POS Ops and Bryan , enabled:true, users:test@email.com, subject:New iSC Tenant, html:def fields = get('/rest/api/2/field')
        .asObject(List)
        .body as List<Map>

def customFieldId = fields.find { it.name == 'TextFieldB' }.id as String
def customFieldValue = (issue.fields[customFieldId] as Map)?.value

"""Dear ${issue.fields.assignee?.displayName},

The ${issue.fields.issuetype.name} ${issue.key} with priority ${issue.fields.priority?.name} has been assigned to you.

Description: ${issue.fields.description}

Custom field value: ${customFieldValue}

Regards,
${issue.fields.reporter?.displayName}"""
, executionUser:INITIATING_USER, userKey:admin, accountId:5afbf021d17d8405fa4357bc]

 

0 answers

Suggest an answer

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

Do you use Jira Cloud with Microsoft Teams?

Hi, Jira users! Do you use Jira alongside Microsoft Teams? We want to hear how you’ve used the power of Jira Cloud and Microsoft Teams (via the Jira Cloud for Microsoft Teams app) to achieve a team...

482 views 3 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