Create a screen with scriptrunner (clone a project)

Hi,

I'm trying to create a real clone of a project with Scriptrunner.

To do that, i need to copy every single element of a project (workflow scheme, workflow, issue type scheme,...)

I'm acutally trying to do that with issue type screen scheme.

There is a manager for this object, but the function to create a issue type screen scheme is odd:

voidcreateIssueTypeScreenScheme(IssueTypeScreenScheme issueTypeScreenScheme) 

And there is no further description.

I tried to dig this issue until the screen object. Even for the screen we have this kind of function:

voidcreateFieldScreen(FieldScreen fieldScreen)

Besides the architecture of the issue type screen scheme is a bit weird, i found this:

The goal is to create FieldScreens, then associate them to upper objects.

 

But there is no real function to create FieldScreenScheme or FieldScreen or 

FieldScreenSchemeItem.

There is still a possibility to create thos object since there are all kind of setters:

voidsetDescription(String description) 
voidsetGenericValue(org.ofbiz.core.entity.GenericValue genericValue) 
voidsetId(Long id) 
voidsetName(String name) 

But that doesn't seems "clean" at all to me. Besides i still need to generate a correct id and i'm not sure how to generate a correcte "GenericValue".

 

Any idea for all this matter ? :)

 

Regards,

 

Laurent Bierge

1 comment

Alexey Matveev Community Champion Nov 16, 2017

Hello, 

There is already built-in script to do the same task. It is called Clone project. Go to cog item->add-ons find built-in scripts in the vertical menu. 

Actually i only have "copy". Besides "copy" don't clone project elements, it share them with the new project.

I want my new project to be independant.

Comment

Log in or Sign up to comment
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jun 14, 2018 in Jira Service Desk

How the Telegram Integration for Jira helps Sergey's team take their support efficiency to the bank

...+ reading Fantasy). The same is true for him at the bank he works for: Efficiency is key when time literally equals money. Read on to learn how Sergey makes most of the time he has by...

498 views 3 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you