Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Push data into array custom field at transition screen

aleksandr_pavlovic March 23, 2018

Hello, 

We are using Query Issues Custom Fields plugin. One of the fields is Query issue multi linker custom field wich stores data in an array.

To change data in that field without user interaction we use:

def cField = customFieldManager.getCustomFieldObject(cField_ID)
def tmp = new ArrayList<String>()
       tmp.add(issue.key)

issue.setCustomFieldValue(cField, tmp)
issueManager.updateIssue(
              currentUser.directoryUser
            , issue
            , EventDispatchOption.ISSUE_UPDATED
            , false);

But it updates that field value for an issue.

 

What we need to achive

When we call a transition_1 we have a screen with an emty Query issue multi linker custom field.

We need to push some data into that field on screen load. And that data should not instantly update an issue field, but be present on that screen only until form is submited. Any advice on how can we achieve that?

image.png

If this situation is plugin scpecific, maybe someone could help me with the sources of that plugin (maybe to achive my goal I have to import some class of that plugin?)

Source on Bitbucket

1 answer

0 votes
Erik Buchholz
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 11, 2020

Hi @aleksandr_pavlovic ,

you are using scriptrunner for this, right?

I think what you want to archive, is to set an default value instead of update the issue.

Take a look at the initialisers of the behavious module from the scriptrunner plugin.

https://scriptrunner.adaptavist.com/latest/jira/recipes/behaviours/setting-default-fields.html

In my opinion the examples from the scriptrunner guys are quite good but if you need some help for the code, just let me know.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events