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,558,653
Community Members
 
Community Events
184
Community Groups

pathsMatchExcludingDeletes() is applicable for argument types: String

Hi,

Am working for a script in order to restrict pushing changes to a particular folder for a specific team.

It was a straight forward script available online. 

https://scriptrunner.adaptavist.com/4.3.19/bitbucket/PreReceiveHooks.html

 

import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.bitbucket.auth.AuthenticationContext
import com.atlassian.bitbucket.user.UserService

def userService = ComponentLocator.getComponent(UserService)
def authContext = ComponentLocator.getComponent(AuthenticationContext)

if (pathsMatchExcludingDeletes("glob:UserGUI/src/localizationsnapshot/**")) {
// return true if the user is NOT in the desired group, thus blocking the push
return ! userService.isUserInGroup(authContext.getCurrentUser(), "!Team Core FTE")
}
return false

 

However, i kept getting below error and there is no much help available to resolve it. 

 

Time (on server): Fri May 28 2021 15:53:55 GMT-0400 (Eastern Daylight Time)

The following log information was produced by this execution. Use statements like:log.info("...") to record logging information.

2021-05-28 14:53:55,467 ERROR [c.o.s.b.ScriptedPreReceiveGlobalHook]: *************************************************************************************
2021-05-28 14:53:55,482 ERROR [c.o.s.b.ScriptedPreReceiveGlobalHook]: Script pre-receive hook failed: repository: jasontest, file: <inline script>
groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.pathsMatchExcludingDeletes() is applicable for argument types: (String) values: [glob:UserGUI/src/localizationsnapshot/**]
	at Script31.run(Script31.groovy:8)
at Script31.run(Script31.groovy:8)

 

Let me know in case of any inputs in this regard.

 

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.
Jun 02, 2021

Hi @Pavan_Nayakanti ,

Please can you confirm which version of Bitbucket and ScriptRunner for Bitbucket you are using and I will look further into this for you.

Kind regards,

Robert Giddings,

Product Manager, ScriptRunner for Bitbucket

What version of ScriptRunner are we using? - 5.6.2
What version of Bitbucket are we using? - 5.15.1

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.
Jun 07, 2021

Hi @Pavan_Nayakanti ,

Thank you for your response.

We no longer support those versions of Bitbucket or ScriptRunner for Bitbucket.

Is it possible for you to first upgrade to a supported version of Bitbucket and ScriptRunner for Bitbucket?

We support versions of Bitbucket, as listed on Atlassian's End of Life policy here: https://confluence.atlassian.com/support/atlassian-support-end-of-life-policy-201851003.html

And again support the compatible versions of ScriptRunner for Bitbucket.

If you first upgrade to a supported version of Bitbucket and ScriptRunner for Bitbucket, and you still get the same error, you could then raise a support ticket with our Support Team.

Please let me know if updating both Bitbucket and ScriptRunner for Bitbucket is possible for you?

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