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

How to create comment or tasks in pull requests with Scriptrunner from Bitbucket v5.9.0?

rlandes December 16, 2020

I'd like to create tasks when a pull request is created via the Custom Event Handler feature from Bitbucket Scriptrunner, but I couldn't manage to find how to do it so far. I did find solutions on this website but they seem not to apply in v5.9.0, for example this one: https://community.atlassian.com/t5/Bitbucket-questions/How-to-auto-comment-Pull-Requests/qaq-p/266093

 

Even after replacing

pullRequestService.addComment

with

commentService.addComment

and after importing the right interface, since I noticed the function switched interface between versions (https://docs.atlassian.com/bitbucket-server/javadoc/5.9.0/api/reference/com/atlassian/bitbucket/comment/CommentService.html), it didn't work, I got the following message in the logs:

groovy.lang.MissingMethodException: No signature of method: com.sun.proxy.$Proxy454.addComment() is applicable for argument types: (Integer, Long, String) values

The solutions I found on other questions got the same fate, and I'm still unable to automatically create tasks or even comments right now.

 

Any solution? Thanks a lot in advance.

 

1 answer

0 votes
Robert Giddings [Adaptavist]
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 13, 2021

Hi @rlandes ,

Using ScriptRunner for Bitbucket, you can also add tasks to Pull Requests using a built-in script. Here is the documentation: https://docs.adaptavist.com/sr4bib/latest/features/listeners/built-in-listeners/add-tasks-to-new-pull-requests

Does this help? Or do you need something more custom?

Kind regards,

Robert Giddings,

Product Manager, ScriptRunner for Bitbucket

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events