Hi.
It makes me some crazy. I need simple string cf setting value based on select list values on issue create screen.
CustomField latitude = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_10400")
CustomField longitude = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_10401")
issue.setCustomFieldValue(latitude, rows.HOUSE_LATITUDE[0].toString())
issue.setCustomFieldValue(longitude, rows.HOUSE_LONGITUDE[0].toString())
log.error("storing changes")
issue.store()
I normally extract and recognize what i need, but i can't store this values in issue. No errors in log.
This is post function on issue createThanks in advice.
Solution is:
CustomField latitude = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_10400")
CustomField longitude = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_10401")
IssueChangeHolder changeHolder = new DefaultIssueChangeHolder()
latitude.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(latitude),rows.HOUSE_LATITUDE[0].toString()),changeHolder)
longitude.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(longitude),rows.HOUSE_LONGITUDE[0].toString()),changeHolder)
issue.store()
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.