We have a custom field namely "JIRA Issue key" in create issue screen. Now we like to put JIRA issue key into this field automatically after issue creation. Is there any way to do this activity?
You need a little bit of code - remove the field from the create screen and find/write a post-function that posts the key into the field instead.
Of course, it's pretty pointless - why don't you just use the key that's already there?
I was able to simply do a post function and copy field to field using the key. It works quite simply. Keep in mind if you resolve the issue, the key will be lined out in the separate custom field. You will need to take the custom field out of the create screen, and put it only in the view screen instead.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Zverov, After using this script no error occurred. But "Jira Issue Key" field also not showing in the view issue screen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic,
Thank you very much for your reply. It is our client requirement. Could you please inform us the detailed steps what we need to do. It will be very helpful for us then
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"I want it" really doesn't answer the question. Why is the client wasting your time with a duplicated and potentially inaccurate field? Have you thought through what happens if the issue moves? That's why I question the requirement - without knowing why they want it and what they plan to do with it, you can NOT usefully define the behaviour or As a side effect, once you know *why* they want a pointless field, you will probably be able to give them a significantly *better* solution than a useless field. If you really do end up having to fulfill a pointless requirement, then the *best* way to do it is 1. Install Script Runner ( https://marketplace.atlassian.com/plugins/com.wittified.jira.project-creator/server/overview ) 2. Use Vasiliy's script above (Yes, point 1 is a bit of an advert as I work for Adaptavist and hence with the Scriptrunner team- there are other add-ons which could do it, but I've always reached for ScriptRunner for all the more complicated stuff, and I'd have posted the same if I didn't work there)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Nic for your explanation. You are absolutely right. We will certainly inform our clients about the side effects you mentioned. But for backup if they ordered us to do so we need to configure this. That is why I am asking this question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's why Vasiliy and I are trying to help :-) While the field is utterly useless and probably the symptom of a broken requirement or thought process, and hence I'm recommending that you ask *why*, we know clients can persist with doing dumb things! So we're still giving you the guidance about how to use the field and how to make it happen!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this script for ScriptRunner postfunction:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.IssueManager import com.atlassian.jira.issue.UpdateIssueRequest import com.atlassian.jira.issue.fields.CustomField /** * Script for copy value from one custom field to another */ //Prepare to update UpdateIssueRequest.UpdateIssueRequestBuilder issueRequestBuilder = new UpdateIssueRequest.UpdateIssueRequestBuilder(); issueRequestBuilder.eventDispatchOption(EventDispatchOption.ISSUE_UPDATED); issueRequestBuilder.sendMail(false); UpdateIssueRequest updIssReq = new UpdateIssueRequest(issueRequestBuilder); CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); CustomField cstFld = customFieldManager.getCustomFieldObjectByName("Name"); if( (cstFld_From == null) { issue.setCustomFieldValue(cstFld, issue.getKey()) issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), issue, updIssReq); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Zverev, Thank you for help. Could you please inform me which type custom field we need to create. Is it "Text Filed" type or "Select List" type or anything else. Do we need to associate this field wth create issue screen?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The code posts a string, so it's a "text" field - I'd use the short one rather than multi-line. You do *not* put it on the create screen - if you did, the user could fill it in and then have your code destroy what they enter. Better not offer it to them or they'll get confused.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, yes, you do *not* want the field on the issue "Create" screen, but you *do* want it on the "View" screen. That's probably why it's not there. Check the view screen (and maybe try the "where's my field" option) for the field. If it is on there, then it might be the script going wrong, but definitely check the screen first.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic, The field is not there. I am inform you the detailed steps which I have followed - 1. Create a Text Field namely "Jira Issue Key" and do not associate with any screen 2. Select Workflow 2. Click Open Step 3. Click Create 4. Add Post function namely "Script Post-Function" 5. Add below mentioned script in "In line Script" section - import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.IssueManager import com.atlassian.jira.issue.UpdateIssueRequest import com.atlassian.jira.issue.fields.CustomField /** * Script for copy value from one custom field to another */ //Prepare to update UpdateIssueRequest.UpdateIssueRequestBuilder issueRequestBuilder = new UpdateIssueRequest.UpdateIssueRequestBuilder(); issueRequestBuilder.eventDispatchOption(EventDispatchOption.ISSUE_UPDATED); issueRequestBuilder.sendMail(false); UpdateIssueRequest updIssReq = new UpdateIssueRequest(issueRequestBuilder); CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); CustomField cstFld = customFieldManager.getCustomFieldObjectByName("Jira Issue Key"); if( (cstFld_From == null) { issue.setCustomFieldValue(cstFld, issue.getKey()) issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), issue, updIssReq); } After adding this the post-function order like this - 1. Creates the issue originally. 2. Script workflow function : A custom script will be run: from inline script. 3. Re-index an issue to keep indexes in sync with the database. 4. Fire a Issue Created event that can be processed by the listeners Publish Workflow Now I create a issue. But after issue creation "Jira Issue Key" not showing in the issue screen Please suggest
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check that this postfunction follows a postfunction that creates an issue. More simple - move this postfunction to the bottom of postfunctions list
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
now i reorder postfunction as below - The following will be processed after the transition occurs 1. Creates the issue originally. 2. Re-index an issue to keep indexes in sync with the database. 3. Fire a Issue Created event that can be processed by the listeners 4. Script workflow function : A custom script will be run: from inline script. i have add this postfunction in create transtion. but still jira issue key field not showing after creating issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In oreder to find a problem tou can do: 1) (cstFld_From == null) is incorrect, you need (cstFld_From != null). Namely it means that custon field is found. 2) Analise atlassian-jira.log for errors.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi zverev, thank you again for your help. right now i am using below mentioned script - import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.IssueManager import com.atlassian.jira.issue.UpdateIssueRequest import com.atlassian.jira.issue.fields.CustomField /** * Script for copy value from one custom field to another */ //Prepare to update UpdateIssueRequest.UpdateIssueRequestBuilder issueRequestBuilder = new UpdateIssueRequest.UpdateIssueRequestBuilder(); issueRequestBuilder.eventDispatchOption(EventDispatchOption.ISSUE_UPDATED); issueRequestBuilder.sendMail(false); UpdateIssueRequest updIssReq = new UpdateIssueRequest(issueRequestBuilder); CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); CustomField cstFld = customFieldManager.getCustomFieldObjectByName("Jira Issue Key"); if ((cstFld_From != null) { issue.setCustomFieldValue(cstFld, issue.getKey()) issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), issue, updIssReq); } i have also check atlassian log. there is a error. please find the error below - unction] Script function failed on issue: SHD-11356, actionId: 1, file: <inline script> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script39.groovy: 26: expecting ')', found '' @ line 26, column 2. } ^ 1 error i like to mention one thing which i observed. i dont whether this is correct or not. in the script 'if' has not closed with 'fi' . also after 'if' there is a '(' has not closed with ') . could you kindly look into this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have additional bracket "(" into if statement. if (cstFld_From != null) { issue.setCustomFieldValue(cstFld, issue.getKey()) issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), issue, updIssReq); } To speed up development see https://answers.atlassian.com/questions/32982259/answers/32982329?flashId=-1332650553
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi zverev, i have remove additional "(" into if statement. after that i getting below mentioned error - unction] Script function failed on issue: SHD-11357, actionId: 1, file: <inline script> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script40.groovy: 6: unable to resolve class com.atlassian.jira.issue.UpdateIssueRequest @ line 6, column 1. import com.atlassian.jira.issue.UpdateIssueRequest ^ Script40.groovy: 14: unable to resolve class UpdateIssueRequest.UpdateIssueRequestBuilder @ line 14, column 46. est.UpdateIssueRequestBuilder issueReque ^ Script40.groovy: 14: unable to resolve class UpdateIssueRequest.UpdateIssueRequestBuilder @ line 14, column 68. Builder issueRequestBuilder = new Update ^ 3 errors also i followed the url u refer. on that url you provide below mentioned example - import com.atlassian.jira.ComponentManager; import com.atlassian.jira.issue.IssueManager; IssueManager issueManager = ComponentManager.getInstance().getIssueManager(); Issue issue = issueManager.getIssueObject("ABC-12345"); in that script i can not understand what ("ABC-12345") is. is this issue key ? if so then do i need to mention a particular issue id in it. i do not understand
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"ABC-12345" is: ABC - is an project key 12345 - is an issue number into the project. Could you provide version of your JIRA instance? UpdateIssueRequest.UpdateIssueRequestBuilder is compatible since JIRA 6.3.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Since use issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), issue, ventDispatchOption.ISSUE_UPDATED, false) Instead issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), issue, updIssReq); And delete import of UpdateIssueRequest.UpdateIssueRequestBuilder into header.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi zverev, 1. i have replaced the line you have mentioned. 2. but i have not understand which line i have to delete. i have used below mentioned script right now - import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.IssueManager import com.atlassian.jira.issue.fields.CustomField /** * Script for copy value from one custom field to another */ //Prepare to update UpdateIssueRequest.UpdateIssueRequestBuilder issueRequestBuilder = new UpdateIssueRequest.UpdateIssueRequestBuilder(); issueRequestBuilder.eventDispatchOption(EventDispatchOption.ISSUE_UPDATED); issueRequestBuilder.sendMail(false); UpdateIssueRequest updIssReq = new UpdateIssueRequest(issueRequestBuilder); CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); CustomField cstFld = customFieldManager.getCustomFieldObjectByName("Jira Issue Key"); if (cstFld_From != null) { issue.setCustomFieldValue(cstFld, issue.getKey()) issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), issue, ventDispatchOption.ISSUE_UPDATED, false); } but using this script below mentioned error occured - wFunction] Script function failed on issue: SHD-11367, actionId: 1, file: <inline script> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script44.groovy: 13: unable to resolve class UpdateIssueRequest.UpdateIssueRequestBuilder @ line 13, column 46. est.UpdateIssueRequestBuilder issueReque ^ Script44.groovy: 13: unable to resolve class UpdateIssueRequest.UpdateIssueRequestBuilder @ line 13, column 68. Builder issueRequestBuilder = new Update ^ Script44.groovy: 16: unable to resolve class UpdateIssueRequest @ line 16, column 20. UpdateIssueRequest updIssReq = new UpdateIssueRequest(issueRequestBuilder); ^ Script44.groovy: 16: unable to resolve class UpdateIssueRequest @ line 16, column 32. UpdateIssueRequest updIssReq = new UpdateIssueRequest(issueRequestBuilder); ^ 4 errors could you please look into this. sorry to bother you again
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just delete this line: UpdateIssueRequest.UpdateIssueRequestBuilder issueRequestBuilder = new UpdateIssueRequest.UpdateIssueRequestBuilder();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi zverov, i have deleted the line as per your suggestion. right now my script is like below - import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.IssueManager import com.atlassian.jira.issue.fields.CustomField /** * Script for copy value from one custom field to another */ //Prepare to update issueRequestBuilder.eventDispatchOption(EventDispatchOption.ISSUE_UPDATED); issueRequestBuilder.sendMail(false); UpdateIssueRequest updIssReq = new UpdateIssueRequest(issueRequestBuilder); CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); CustomField cstFld = customFieldManager.getCustomFieldObjectByName("Jira Issue Key"); if (cstFld_From != null) { issue.setCustomFieldValue(cstFld, issue.getKey()) issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), issue, ventDispatchOption.ISSUE_UPDATED, false); } but still i got below mentioned error - Function] Script function failed on issue: SHD-11371, actionId: 1, file: <inline script> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script47.groovy: 15: unable to resolve class UpdateIssueRequest @ line 15, column 20. UpdateIssueRequest updIssReq = new UpdateIssueRequest(issueRequestBuilder); ^ Script47.groovy: 15: unable to resolve class UpdateIssueRequest @ line 15, column 32. UpdateIssueRequest updIssReq = new UpdateIssueRequest(issueRequestBuilder); ^ 2 errors
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, try this: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.IssueManager import com.atlassian.jira.issue.fields.CustomField /** * Script for copy value from one custom field to another */ //Prepare to update CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); CustomField cstFld = customFieldManager.getCustomFieldObjectByName("Jira Issue Key"); if (cstFld_From != null) { issue.setCustomFieldValue(cstFld, issue.getKey()) issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), issue, ventDispatchOption.ISSUE_UPDATED, false); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi zverov, after trying this script i am getting below mentioned error - Script function failed on issue: SHD-11377, actionId: 1, file: <inline script> groovy.lang.MissingPropertyException: No such property: cstFld_From for class: Script53 at Script53.run(Script53.groovy:16)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi zverov, after trying the script you have provided i got below mentioned error - Script function failed on issue: SHD-11377, actionId: 1, file: <inline script> groovy.lang.MissingPropertyException: No such property: cstFld_From for class: Script53 at Script53.run(Script53.groovy:16) also i like to mention about a line - CustomField cstFld = customFieldManager.getCustomFieldObjectByName("Jira Issue Key") the "Jira Issue Key" field is a name of a test field which i want see with jira issue key value. is it right ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.IssueManager import com.atlassian.jira.issue.fields.CustomField /** * Script for copy value from one custom field to another */ //Prepare to update CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); CustomField cstFld = customFieldManager.getCustomFieldObjectByName("Jira Issue Key"); if (cstFld != null) { issue.setCustomFieldValue(cstFld, issue.getKey()) issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), issue, ventDispatchOption.ISSUE_UPDATED, false); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi zverov, yes i have used this script which you have send me already. the script is as below - import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.IssueManager import com.atlassian.jira.issue.fields.CustomField /** * Script for copy value from one custom field to another */ //Prepare to update CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); CustomField cstFld = customFieldManager.getCustomFieldObjectByName("Jira Issue Key"); if (cstFld_From != null) { issue.setCustomFieldValue(cstFld, issue.getKey()) issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), issue, ventDispatchOption.ISSUE_UPDATED, false); } but after trying the script you have provided i got below mentioned error - Script function failed on issue: SHD-11377, actionId: 1, file: <inline script> groovy.lang.MissingPropertyException: No such property: cstFld_From for class: Script53 at Script53.run(Script53.groovy:16) also i like to mention about a line - CustomField cstFld = customFieldManager.getCustomFieldObjectByName("Jira Issue Key") the "Jira Issue Key" field is a name of a text field which i want see with jira issue key value. is it right ? or "Jira Issue Key" is a variable which you used for example. for my case it is a valid text field. this test field is not associate with any issue screen. when a issue will create (suppose - shd-11358) , "Jira Issue Key" will should be show in view screen with shd-11358 value. please suggest
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Now trouble is that we use variable cstFld to store an object to operate with custom field. Into if statement variable cstFld_From is used. But there is no defenition of this variable. A posted last comment from a smartphone since it is bad formated. import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.IssueManager import com.atlassian.jira.issue.fields.CustomField /** * Script for copy value from one custom field to another */ //Prepare to update CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); CustomField cstFld = customFieldManager.getCustomFieldObjectByName("Jira Issue Key"); if (cstFld != null) { issue.setCustomFieldValue(cstFld, issue.getKey()) issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), issue, ventDispatchOption.ISSUE_UPDATED, false); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi zverov, after using below mentioned script as per your suggestion - import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.IssueManager import com.atlassian.jira.issue.fields.CustomField /** * Script for copy value from one custom field to another */ //Prepare to update CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); CustomField cstFld = customFieldManager.getCustomFieldObjectByName("Jira Issue Key"); if (cstFld != null) { issue.setCustomFieldValue(cstFld, issue.getKey()) issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), issue, ventDispatchOption.ISSUE_UPDATED, false); } i am getting below mentioned error - Script function failed on issue: SHD-11378, actionId: 1, file: <inline script> groovy.lang.MissingPropertyException: No such property: issueManager for class: Script54 at Script54.run(Script54.groovy:19)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.IssueManager import com.atlassian.jira.issue.fields.CustomField /** * Script for copy value from one custom field to another */ //Prepare to update CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); CustomField cstFld = customFieldManager.getCustomFieldObjectByName("Jira Issue Key"); if (cstFld != null) { issue.setCustomFieldValue(cstFld, issue.getKey()) ComponentAccessor.getIssueManager().updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), issue, ventDispatchOption.ISSUE_UPDATED, false); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi zverov, after using latest script the error is bit different. please find the error below - Script function failed on issue: SHD-11381, actionId: 1, file: <inline script> groovy.lang.MissingPropertyException: No such property: ventDispatchOption for class: Script57 at Script57.run(Script57.groovy:19)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Missed "e". Here is a corrected script import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.IssueManager import com.atlassian.jira.issue.fields.CustomField /** * Script for copy value from one custom field to another */ //Prepare to update CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); CustomField cstFld = customFieldManager.getCustomFieldObjectByName("Jira Issue Key"); if (cstFld != null) { issue.setCustomFieldValue(cstFld, issue.getKey()) ComponentAccessor.getIssueManager().updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), issue, eventDispatchOption.ISSUE_UPDATED, false); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi zverov, after using very latest script now error is as below - Script function failed on issue: SHD-11384, actionId: 1, file: <inline script> groovy.lang.MissingPropertyException: No such property: eventDispatchOption for class: Script60 at Script60.run(Script60.groovy:19)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tested this code on my JIRA, good luck: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.IssueManager import com.atlassian.jira.issue.fields.CustomField /** * Script for copy value from one custom field to another */ //Prepare to update CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); CustomField cstFld = customFieldManager.getCustomFieldObjectByName("Jira Issue Key"); if (cstFld != null) { issue.setCustomFieldValue(cstFld, issue.getKey()) ComponentAccessor.getIssueManager().updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser().getDirectoryUser(), issue, EventDispatchOption.ISSUE_UPDATED, false); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On issue screen press button "Admin" and into dropdown list select "Where my field". There are two common reasons that field is not shown: value is empty or field is not present on a sceen. Try this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Zverov, Thanks a ton !!!! It is working after I associate this field with view issue screen. Thank you very much for your constant support. I highly appreciate your grat support on behalf of my team
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great, could you mark this answer as solution for future users of Atlassian Answers to make them sure that this will help them?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.