Comments
-
Hi Rex, Behaviours work on the create and edit screens by default but do not work when a field is inline edited. Thanks Kristian
-
Hi Rex, Yes you would need to use Behaviours to implement similar functionality on the edit issue screen. An example of how you could achieve this is shown below. Code: // Required Importsimport com.atlassian.jira.component.ComponentAccessor// Get a pointer to my select list fielddef selectList =…
-
Glad I was able to help.
-
Hi Rex, I can confirm that a Simple Scripted Validator provided by the Script Runner plugin could be placed on the create transition of the issue in order to solve your requirements outlined below. The way the validator would work would be to check to see if the Issue type was Bug and if so it would check if the Capital…
-
You would be best to use Jamies template above the for to make the Field a Date / Time picker field. Otherwise use a script listener which updates a date field based on the value of the Duration to close field.
-
What do you mean by setCustomFieldValue. I used the code as a scripted field called "Close Date" using a text field renderer.
-
Hi Amar, I have looked at you code and have been able to format the returned Date/Time string using Java Simple Date format so that the returned output now shows the Day of the week, Day , Month and Year. My refactored code is below with the two lines that are changed being lines 39 & 41 where I specify the date format and…
-
You may also find the article at https://confluence.atlassian.com/jirakb/how-to-automatically-add-request-participants-when-creating-an-issue-777026955.html here which shows how you can set users in the request participants field using a Post function which you may be able to convert into a behaviour. Thanks Kristian
-
Hi Bartek, Sorry about the link it should of pointed to https://docs.atlassian.com/jira-servicedesk/REST/cloud/#servicedeskapi/request/{issueIdOrKey}/participant-addRequestParticipants I hope this helps. Kristian
-
Hi Bartek, Service desk uses system fields which cannot be set by the normal JIRA API. However the latest versions of JIRA Service Desk contain a rest API which will allow you to use a Post Request to set Request participants. An example of the Add Participants method in the API can be viewed here. I hope this helps…
-
You are welcome Sadek. Please let me know if helps you to solve your issue.Kristian
-
Hi Sadek, I have enclosed a Script Runner solution below of how you can copy the previous attachment from an issue over to another issue. This code can be edited if needed to automatically specify the issue key of the issue that the attachment should be copied to. import com.atlassian.jira.component.ComponentAccessorimport…
-
Hi Flamio, If this answer is now working as expected could you please accept it so that users who have a similar query can easily find the solution. Thanks Kristian
-
Hi Flamio, I have looked at this and noticed the line in the if should be changed to issue.setAssigneeId(implUser.username.toString()) as the setAssigneeId method expects the username of the user. I have updated the example code above. This new code should set the avatar on the Kanban board. I hope this helps. Thanks…
-
Hi Flamio, I have attached a sample script which take the value from a custom user picker such as one called Implemented By and set it to the Assignee field during a transition. import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.user.ApplicationUser// Get required Managersdef customFieldManager…
-
Hi Davor, I have attached an example of how you can create a Scripted Field called Sprint Dates which will show for an issue what the Start and End dates for the sprint are. I have attached below the code and config for the Scripted Field along with a screenshot of what the output on an issue looks like. Code: // Required…
-
Hi Sanu, Below I have attached a sample script wrote for JIRA 6.4 which will get the change history information for the previous transition. This script should be placed inside a Scripted Field. Please note if you are using this on a different version of JIRA then you may need to update this slightly. import…
-
Hi Jan, Glad I was able to help. If the answer is useful could you please mark it as accepted incase other are searching for a question similar to this one. Thanks Kristian
-
Hi Ja, I have managed to replicate your issue using Scriptrunner 3.1.4, nfeed 5.4.1 and JIRA 6.4.12. The reason that the behaviour fails to execute is due to the fact that the nFeed field does not support being made required. This is due to the fact that the field is a field which is programmatically populated from an…
-
Hi Madhava, I have attached below a sample script of how you can get all the users in a group in a custom field in JIRA 7.1 along with a screenshot of the Config for this group which shows how it works. import com.atlassian.jira.component.ComponentAccessor def groupManager =…
-
Hi Vijay, I have enclosed below a sample Behaviour script which can be applied to the field read only. The script will check to see if the current user is in a group such as the jira-administrators group and if the user is in the administrators group then it will make the field writeable else it will be read only for all…
-
Hi Josh, Could I check where you will be storing the flagged value as you have tagged lots of different plugins above. However if you want to use Script Runner then you could create a Script Field which returns a number return type to show when an issue is flagged using the example code below. // Get the Values of the…
-
Can you please try removing the transition screen and test if the validator works as expected without the transition screen. Thanks Kristian
-
Are you using the simple scripted validator provided by the Script Runner plugin as the two code snippets above are the will work for ensuring a linked pressent before the transition is allowed. Also can you please share some screenshots of what you have configured and the extracts of the atlassian-jira.log file from when…
-
Have you placed yout post function so that it is the last post function in the list and appears below the Re-index an issue to keep indexes in sync with the database post function?
-
Hi Brian, I have attached an example as shown in the screenshots in the document here which shows how you can add a Simple Scripted Validator to a transition to say the transition can only occur when an issue has one of more linked issues. In the example attached I am blocking the To-Do to In Progress transition when no…
-
Hi Karl, The solution provided above by Filip is what you need to use ensuring you run this code as a scripted field on the issue. I have attached a sample of how you can set this code as a scripted field in order to achieve your requirements. Screen Shot 2016-08-19 at 16.05.05.png I hope this helps. Thanks Kristian
-
Hi Mel, You can do this with Behaviours. I have enclosed a sample script below which checks the value in Radio Button A and when option 1 is selected clears the value in Radio Button B. Note that by default JIRA excludes the none option from the options map so we have to include this before we can set the value to no value…
-
Hi Gorzech,I have tried my code above on Jira 6.4.6 using Script Runner version 3.1.4. I can confirm that it is setting the values of the options map correctly by viewing these in the browser console but these are not getting rendered to the screen for the issue type field.This looks to me like a bug in Jira 6.4 that you…
-
Hi Gorzech,You need to use log4j statements to write out to the log.Can you please confirm if the enable logging link has been clicked on the Behaviours home screen.Kristian