How to copy assignee property to custom field of an issue in workflow transition?
You can do this with scripting (Script Runner free plugin, Groovy), or with Kepler's SIL (http://confluence.kepler-rominfo.com/display/SIL/getUserProperty) which is another scripting langiage (probably simpler then Groovy). Is this an option for you?
I do not know a plug-in that provides it "out of the box".
Thanx. Maybe you know code how to do it in Script Runner? Or point me to the documentation where I could dig that info?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do not have a code that does exactly this (ie get UserProperty and set it in a CustomField),
But, one of the trickiest things to note is the very specific scheme to follow to make sure that your update to the custom field is actually written into the DB and persisted. To acieve this you should follow a similair scheme to this:
MutableIssue myIssue = issue
//Update hoursSummaryString CustomField hoursSummaryString=customFieldManager.getCustomFieldObjectByName(hoursSummaryStringFieldName) myIssue.setCustomFieldValue(hoursSummaryString, billingStr) Map<String, ModifiedValue> modifiedFields1 = myIssue.getModifiedFields() FieldLayoutItem fieldLayoutItem1 =ComponentManager.getInstance().getFieldLayoutManager().getFieldLayout(myIssue).getFieldLayoutItem(hoursSummaryString) DefaultIssueChangeHolder issueChangeHolder1 = new DefaultIssueChangeHolder() final ModifiedValue modifiedValue1 = (ModifiedValue) modifiedFields1.get(hoursSummaryString.getId()) hoursSummaryString.updateValue(fieldLayoutItem1, myIssue, modifiedValue1, issueChangeHolder1)
For the user property itself, you can have a look here:
https://answers.atlassian.com/questions/112783/script-how-to-get-value-of-user-property
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.