Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

groovy script related query

Ashima Bhatia June 26, 2024

Hi team,

Kindly assist in resolving below error, that I get while running a scriptrunner script in workflow post function.

 

groovy.lang.MissingMethodException: No signature of method: com.atlassian.jira.permission.WorkflowBasedPermissionSchemeManager.removeSchemesFromProject() is applicable for argument types: (String) values: [AB]

 

I checked existing community answers as well but no luck.

 

Thanks

Ashima Bhatia

3 answers

0 votes
Ashima Bhatia June 26, 2024

Hi team,

Thanks for the answers. Perhaps I did not specify the problem statement clearly.

Requirement: I want to archive a project whenever a workflow transition happens. There is a status in my workflow named 'Archive'. So, when I select this status, my project(which is passed as a field in project) must be archived.

For executing this, I have a archival script which runs perfectly on script runner console, but gives lots of errors when I pass it in post function of Archive status transition: custom script post function.

Before I share the script, is there any other way to achieve archival of project during status transition instead of using the script?

Thanks

Ashima Bhatia

0 votes
Radek Dostál
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.
June 26, 2024

For someone attempting to de-associate some schemes from a project in a workflow post-function, which all by itself is rather endearing and makes me question what you're doing, you certainly do have trouble reading the error message and thinking about what it's stating in plain english.

 

I truly have no idea why you would be calling that manager and trying to revoke some scheme from somewhere in a post-function. This really screams bad idea to me that should probably not be a post-function at all.

 

As Dirk already pointed out, and as the message states, you're passing an invalid data type into the `removeSchemesFromProject` method. Why you would need to call this method is a bigger question to me as opposed to what you're passing into it.

 

Before you fix that and move forward, I think it might be better to take a step back and think about what you're trying to do there, and whether it wouldn't make sense to do it in a better way. This does not sound like a good idea for a post-function in my opinion.

0 votes
Dirk Ronsmans
Community Champion
June 26, 2024

@Ashima Bhatia ,


Can you share the piece of actual code that this error comes from? Seems like the argument you are passing is not the  correct datatype.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events