Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,553,478
Community Members
 
Community Events
184
Community Groups

Set a hidden field used by Backbone Issue Sync

Edited

Hi,

we're using Jira Server with Script Runner 6.15.0 and Backbone Issue Sync 4.1.5.

We have two custom fields whose values should be transferred to another Jira instance using "Backbone Issue Sync" depending on issue status.

My first idea was to create an additional Custom Field of the same type for each of these two fields, which is not displayed on any screen. These additional fields should be filled via Behaviour Script with the value of the corresponding displayed field (taking the Issue Status into account) and Backbone Issue Sync should transfer the values of these hidden fields. My script for the Date Picker field looks like this (a server side script on field "Offer valid thru" at the moment without considering the issue status):

import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()

def offerValidThruField = getFieldById("Offer valid thru" )
def offerValidThruJ4CField = customFieldManager.getCustomFieldObjectByName("Offer valid thru J4C" )

if ( offerValidThruField && offerValidThruJ4CField) {
    def offerValidThruValue = offerValidThruField.getValue()
    underlyingIssue.setCustomFieldValue(offerValidThruJ4CField , offerValidThruValue )
}

Unfortunately the additional field "Offer valid thru J4C" is not filled by this script with the value from "Offer valid thru". An additional problem I suppose: if the field would be filled by this script, then this would happen for example while the edit screen is still open. If the edit screen would be closed via Cancel, then "Offer valid thru J4C" probably would still ccontain the changed value. But I probably can't use the method field.setFormValue(), because the field is not displayed on the screen.

My other thought is to create these two additional fields as script fields, and define in the associated script that these fields get their values (if the issue status condition is met), from the associated displayed fields. However, since the two additional fields should never be displayed, the question is whether "Backbone Issue Sync" would also call the script to retrieve the values when synchronizing during its sync.

It would be really great if anyone has any tips.

Thanks in advance, best regards!

Frank

1 answer

1 accepted

1 vote
Answer accepted
Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Dec 23, 2020

Hi @Frank Winkler

I'm Matthias from the Backbone team. I have to admit that I didn't work too much with Scriptrunner's behaviour functionality, but your script fields solution sounds good to me.

My understanding of the solution would be:

  • Create a scripted field in the source instance & don't show it on a screen.
  • Define a field mapping in Backbone from the scripted field to some (text) field. This target field has to be on a screen so that Backbone can write to it.

As a side remark: Backbone usually only synchronizes changes which are reported in the issue's history. We rely on that to determine which fields have actually been changed. Since a scripted field never appears in the history, we synchronize this always when some other field which is defined in the sync is getting changed, see also our docs.

Does this help? If you want to discuss your use case in private, you can also reach out to our support team via help@k15t.com.

Cheers,
Matthias.

Hi Matthias,

thank you very much for your answer. Unfortunately - for this matter - I am on vacation at the moment. I will come back to the office on 4.1. and will try this as soon as possible. I'll be back in touch to report on the success.

Best regards!

Frank

Hi Matthias,

we checked this last week. It works! So, thanks again for your help.

Best regards!

Frank

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events