Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


customField not being update on Advance Roadmaps for JIRA server 8


I have Scriptrunner script that reads a an Epic does a calculation and writes to a custom field in the Epic.  This script gets read when epic is viewed


The custom field works gets updated in the epic correctly, however when I use the custom field in a Roadmap plan, it never updates unless I go into the field in roadmaps change the value and click Review.  For the benefit of testing I have set the CustomField as Text and Free Text searchable.

My code snippet as follows:


if ( == "Epic") {
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField customField = customFieldManager.getCustomFieldObject(EpicTotalOriginalEstimateField)
def issueManager = ComponentAccessor.getIssueManager()
// def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

if (customField != null) {
//def changeHolder = new DefaultIssueChangeHolder()
// Double db = daysForEpic
String db = ""+daysForEpic
mIssue.setCustomFieldValue(customField, daysForEpic)
customField.updateValue(null, mIssue, new ModifiedValue(cfieldValue, db),changeHolder)
//MutableIssue issueMute = issueMger.getIssueObject("LS-11050") as MutableIssue
//issueMute.setCustomFieldValue(customField, "100")
//ComponentAccessor.getIssueManager().updateIssue(user, issueMute, EventDispatchOption.ISSUE_UPDATED, false)
// issueMger.updateIssue(user, mIssue, EventDispatchOption.DO_NOT_DISPATCH, false)

I have called both setCustomFieldValue and updateValue

If I call updateIssue (as commented out) it kills my jira server.   We are doing this because of the limitations of Advance Roadmaps that cant display calculated Custom fields.


I would appreciate any help in this.





2 answers

@mark.lamport  I've found that if you send an IssueEvent through EventPublisher, Roadmaps will update the value in the plan.

eventPublisher.publish(new IssueEvent(
Collections.singletonMap("someIgnoreEventFlag", true),
null, EventType.ISSUE_UPDATED_ID));

It might be a good idea to have this Collections.singletonMap("someIgnoreEventFlag", true),

that you can check in your own event listeners and decide not to react to them (otherwise you could get an infinite loop kind of thing happening). You can do that with

if(issueEvent.getParams() != null && issueEvent.getParams().containsKey("someIgnoreEventFlag")) return;

In your event listeners.


The downside to this solution I guess is there are other apps, other than roadmaps, that are going to get triggered, and in my case I don't need to neccessarily change the value, but rather have Roadmaps sync the value on first run, so other apps will react to no change. What are the implications of that, depends on other apps that are installed, so no way of knowing what the consequences would be.

I suspect it's because the event is not being dispatched. I have similar code, and seems like updating with the code that you have commented out, and dispatching EventDispatchOption.ISSUE_UPDATED event, triggers something in Roadmaps to update the value in the plan.

For me it's problematic because I don't want to dispatch the event :D

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events