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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

199 views 1 18
Join discussion

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