How can I share a board with project by scriptrunner?

Zarrev July 24, 2017

Hi all!


I wrote a groovy code in scriptrunner which is genererate a project with scrum board. It is a post-function because project generated from issue. It has got one problem. When I delete the project, then board still exist. So I figured it out that when I generate again project then code won't make another board, just share with project. I searched on internet last whole day, but I didn't find similar issue. I tried to delete the board what was successful but its filter still exsist and it somehow caused some problem when I generate an I read the script runner's sources: https://scriptrunner.adaptavist.com/latest/jira/scripting-other-plugins.htmlhttps://scriptrunner.adaptavist.com/latest/jira/plugins/working-with-jira-agile.html
How can I share a board with project by scriptrunner? I would like to fill out this field with project by scripting.

Capture.PNG

I am using the following versions: JIRA v6.4.10 (server); JIRA Agile v6.7.0 ; Adaptavist ScriptRunner for JIRA 4.1.3.24

Thank you in advanced!

 

UPDATE:

Related issue: https://community.atlassian.com/t5/Answers-Developer-Questions/JIRA-Java-plugin-ProjectService-createproject-creates-project/qaq-p/513836?posted=614874#U614874

1 answer

1 accepted

0 votes
Answer accepted
Zarrev July 26, 2017

Hello guys, I did it! :) But I got another problem... I set the filter's share. It is okey, after that on project view the board is not appear. I found a solution, what is cache clear. Is it safe?
Code: 

ComponentAccessor.getProjectManager().refresh()
ComponentAccessor.getComponent(EventPublisher.class).publish(ClearCacheEvent.INSTANCE)

 It seemed long to run. Is it okey? (On my Sandbox Jira server)
Our official server is bigger with more projects, then If I use this, it will be more longer?

 

Picture about not-showing-board-place:

Capture.PNG

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events