It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

unable to set a field - true of false using behaviour plugin based on a field value change during bulk edit

Hi All,

I have a single choice select field, when ever there is a change in value and the selected value is not equal to the original value, i will set another text field to true using a behaviour script. It works fine during single edit but not during the bulk edits.  Is it possible to exhibit the same using the bulk edits.


Please let us know

2 answers

Behaviours works on the Create, Edit, and Transition screens in JIRA, but only in those contexts. It won't work with changes done through bulk edits, post-functions, or the REST API.  It's very javascript-y.

It sounds like you will want to write either a scripted field or a listener (both available with ScriptRunner). The scripted field is probably the more elegant solution, so that's the one I'll describe.

The scripted field could replace your text field, and you could set its value based on the change history of the select list field. You would write your scripted field to find the original value of your select list field using the ChangeHistoryManager. You can then compare the original value of the select list to the current value, and set the value of your scripted field based on the outcome. This way you don't need to worry about detecting changes.

Thanks for your help. Do you have any documentation of this solution!

No, sorry. I would just search for other ScriptRunner scripts that use the ChangeHistoryManager. Also, I'd do some testing in the Script Console first to see what I was working with. Just grab an arbitrary issue with the IssueManager and then use the ChangeHistoryManager to getAllChangeItems() for that issue. If you leave that variable as the last item in the script, the Script Console will print it to screen when you run and give you a good idea of what you're working with.

Thanks Schott. Based on the document i read , the scripted fields are read only is that correct?

Thanks for your help Schott. I got it working using change-history manger . The only issue with that it is a read only field which i cannot change , so i have to add an additional field to do the manipulation.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

1,933 views 8 2
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you