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

JSM how to create comment on customer behalf (Using ADMIN token)

Hello, I have my own application, which already can create issues in JSM using REST API

 

curl --request POST \

  --url 'https://{portal}.atlassian.net/rest/servicedeskapi/request' \

  -u <secret-here>\

  --header 'Accept: application/json' \

  --header 'Content-Type: application/json' \

  --data '{

  "raiseOnBehalfOf": "user@email.here",

  "serviceDeskId": "1",

  "requestTypeId": "1",

  "requestFieldValues": {

    "summary": "Request JSD help via REST",

    "description": "I need a new *mouse* for my Mac"

  }

}'

 

Property raiseOnBehalfOf helped me to specify customer's email, and issue was created with customer email as reporter

 

But now I need to add comment to JSM issue on customer behalf. REST API for comment creation contains only .body and .public fields.

https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/#api-rest-servicedeskapi-request-issueidorkey-comment-post

I don't see a property raiseOnBehalfOf or anything like that.

{"errorMessages":["Unrecognized field \"raiseOnBehalfOf\" (Class com.atlassian.servicedesk.api.rest.dto.domain.comment.CommentCreateDTO), not marked as ignorable\n at [Source: org.apache.catalina.connector.CoyoteInputStream@5877bceb; line: 5, column: 2] (through reference chain: com.atlassian.servicedesk.api.rest.dto.domain.comment.CommentCreateDTO[\"raiseOnBehalfOf\"])"]}% 

 

I also found java api 

createServiceDeskComment

@Nonnull
ServiceDeskComment createServiceDeskComment(@Nonnull
                                                     com.atlassian.jira.user.ApplicationUser user,
                                                     @Nonnull
                                                     ServiceDeskCommentCreateParameters createParameters)
Create a new service project comment with the provided ApplicationUser as the author
But I think I'm unable to use it because we are working with JSM Cloud
I've spent many hours trying to find a solution. And only one way I see is to use Connect App with JWT tokens / OAuth tokens and avoid using Admin API token. But it looks "too much" for my small task. Any tips how to create comments on customer behalf ?

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Dec 25, 2021

Hi @Shovel Box 

This is a good starting point, please find the ref link here

https://community.developer.atlassian.com/t/raise-comment-on-behalf-of-customer-via-api/28342

Thanks,

Pramodh

so, only the way is to use connect app? I have no idea why rest api allows to create issues on customer behalf but not comments...

Like Meu Dinheiro likes this
TAGS
AUG Leaders

Atlassian Community Events