Forums

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

Apply Script to user editable field

David Doria
Contributor
July 24, 2020

Is it possible to make a 'Select List (multiple choices)' field that a user can interact with but is also controlled by a script? For example, I want a parent issue to "inherit" the selections of a field of its children if it has any, but if it does not, then allow the user be able to edit the field as normal.

I looked at Behaviors, but those appear to apply only on "Screens". I have a constraint that I also want this field to be "live" in Structure, where there is no such "Screen" on which the Behavior would apply.

Is this possible?

Thanks,

David

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Nic Brough -Adaptavist-
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 Champions.
October 15, 2021

Where are you running this?  And what is the rest of the script doing?

Albert Cameron
October 15, 2021

I run it in a postfunction outsourced to an own plugin

Nic Brough -Adaptavist-
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 Champions.
October 15, 2021

Ok, what does the rest of the postfunction do?

Albert Cameron
October 15, 2021

it calls a REST Api and sending the data retrieved from the issue fields.

Nic Brough -Adaptavist-
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 Champions.
October 15, 2021

Ok, so can you walk through replicating this problem?  You've talked about cloning and updating issues, but I think we need to see the whole thing (that's why I asked about the rest of the post-function - I didn't know if you were cloning/updating in there).  If you could sketch out something like:

  • Clone ABC-123 to create ABC-456
  • Amend field on ABC-456
  • Transition issue, going through my post-function that
    • Gets some data from <remote system>
    • Works out what to do with it
    • Updates the employee field (as per posted code)
  • And then say where the problem occurs - like "the employee field on ABC-456 remains as what was on ABC-123", or "I clone ABC-456 and do exactly the same process creating ABC-789, but the employee field takes on the value from ABC-123"

That would be really helpful

Albert Cameron
October 15, 2021

There is a issue of type order . And it has subissue connected to it of type person

So I trigger a postfunction in order and it will read field contactaddress from person and send it to backend. So because I cannot trigger the postfunction again , I need to clone the order issue with person issue will also be connteced to the clone. If I now change value of field contactaddress in person and again trigger the clone order issue I would expect that the updated value will be sent to backend . But this is not the case. Instead old value is read and sent to backend. Honestly I do not know where this old value is available. Really weird.

Nic Brough -Adaptavist-
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 Champions.
October 15, 2021

I am sorry, but I am struggling to understand what your process steps are there.  Could you go over it again, but use Jira actions to explain it, and differentiate between the different issues? 

It is unclear what your "need to clone" and "send to back end" mean, and what issue you are talking about.  I understand that you have an order issue type and a person issue type, but there are at least three separate issues involved in your walkthrough and I cannot tell which ones you are talking about when you just say "order" or "person"

We really do need to have this done in jira-speak - something like:

  • I create a new issue (type order), it gets called ABC-123
  • I create three sub-tasks beneath it (type person), they are ABC-124, ABC-125, ABC-126
  • I transition ABC-123 from "new" to "in progress", which makes my post-function run
  • I edit ABC-123, changing the field contactaddress

and so-on.

TAGS
AUG Leaders

Atlassian Community Events