I am looking for auto incremental field which will give me how many days issue stays in particular state.
I will clear the field in postfunction once status changed.
Eg: If issue created on 10-11-2018 and it is "Open Status" then field should have value "2" as on 12-11-2018.
initially it will 0 (0+1+1)
I am using script runner as well.
You would need an add-on for it.
For example, you could use the Power Custom Fields Premium add-on:
You could create a sil field with a script like this:
return currentDate() - created;
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