It's all about the answers!

Ask a question

Both Calculated and Manual Value

Kurtulus YILDIRIM (68916) | asked Aug 18 '14, 10:08 a.m.
We developed a simple code to calculate due date according to severity and priority. It works fine and sets due date with calculated date info but sometimes due date is needed to set manually. Is there a way to use both calculated value and manually set value?
Thank you.

Donald Nong commented Aug 19 '14, 2:12 a.m.

Can you use the calculated value as the default value and allow the attribute to be modified?

Kurtulus YILDIRIM commented Aug 19 '14, 10:54 a.m.

I tried it but it didn't work.

Accepted answer

permanent link
Eric Jodet (6.3k5111120) | answered Aug 19 '14, 2:50 a.m.
I assume that your issue is that manually entered due dates are overridden by calculated value after saving the work item, right?

If this is the case, a possible un-tested workaround could be to:
- make the due date read-only and use the calculated value
- a new boolean "Override" attribute - default is false (not selected)
- add presentation for this presentation
- modify your script so that value is calculated only if Override is false

Kurtulus YILDIRIM selected this answer as the correct answer

Kurtulus YILDIRIM commented Aug 21 '14, 5:12 a.m.

Thank you Eric,
However I did it in another way, I used state attribute. If state is null (New created defect), my script works otherwise It doesn't.
Thank you and have a nice day.

Your answer

Register or to post your answer.