Is it there a way to allow sync from single Jira project only?

Originally asked by Daniel on 23 April 2021 (original question)


Hi, I´ve connected two Jira systems belonging to different companies. The purpose of this deployment was just to keep single project in both sides synched

However both Jira systems has many other projects and all of them show the Exalate options (menu/buttons) and we need to prevent them to be used.

Is it there a way to disable Exalate controls in specific projects or is it there a way to implement this in the sync rules scripts?


Answer by Francis Martens (Exalate) on 23 April 2021

Yes - you can disable the buttons in the general settings.

The sync can then be started using triggers

https://docs.idalko.com/exalate/display/ED/Triggers


Comments:

Daniel commented on 23 April 2021

You mean the First Sync, correct? Are next syncs affected?

Trigger will start sync every time I create an issue that matches its condition (issue belonging to the desired project).

Is it there a way to make the first sync optional?

Francis Martens (Exalate) commented on 23 April 2021

You lost me about ‘first sync’
Can you elaborate

Daniel commented on 23 April 2021

Francis Martens (Exalate) I think I’ve found how to solve the issue. I modified outgoing script as follows:

if (issue.projectKey != "PKEY"){
// do nothing
}
else {
replica.key = issue.key
replica.type = issue.type 
replica.assignee = issue.assignee 
replica.reporter = issue.reporter
...

}

When pressing Exalate button in any other project with projectKey different than “PKEY”, an empty replica is generated and the sync is ignored. No changes after pressing the button.

If the button is pressed in project “PKEY”, the sync progress successfully.

My comments about firstSync was because my concern was about not just synching existing issues but to avoid creating NEW issues in the other side, when a user press Exalate by mistake in another project.

Is this solution valid?

Francis Martens (Exalate) commented on 24 April 2021

The solution looks valid. The only thing is that the sync will not happen in case of other projects. As long as the user is not expecting it, I guess it is fine

ps. you can also do

if (issue.projectKey != "PKEY") return


replica.key = issue.key
replica.type = issue.type 
replica.assignee = issue.assignee 
replica.reporter = issue.reporter