Copy Sprint Start Date or End Date to Issue Date Field

Issue #569 resolved
Nico Harold created an issue

Was looking for a way to automatically update a Start or End date field on an issue based on the Sprint's Start and End dates that an issue belongs to. I looked through the documentation but do not see anything that would allow for this.

Essentially I am trying to use a refresh backlog estimates transition to calculate story points to original estimate, and then also estimate the start date and end date of an issue based on the sprint. We use BigPicture and it would help us with resource allocations.

Comments (16)

  1. Fidel Castro Armario repo owner

    Hi Nico,

    Currently sprint's start and end dates are not available for JIRA Workflow Toolbox. I will investigate whether they can be supported by the plugin.

    I will keep you informed at this issue.

  2. Nico Harold reporter

    This is a bit of a hacky way to getting a Start Date, but say our Sprint Names are Project + Date of Sprint Start. For example if we named our sprint simply "EXP-04/04/2017". Is there a way to parse the text using JWT to get rid of the Project Prefix to just leave me with a date that I can copy over to the Start Date field?

    From there I could probably make another post function and use add days with the Start Date to add however many days our sprints last to come up with a projected End Date.

    Please let me know if this is possible. I was looking at the String Expressions, would this work: substring("%{10006}", 4, 14) ? I was thinking this might not work because 14 would be the last character of the date and it would be needed for me to get the date.

  3. Fidel Castro Armario repo owner

    You set a Date Picker field from the date in Sprint's name by using "****" post-function with a formula like this one:

    stringToDate(replaceFirst(%{nnnnn}, "^\\D*", ""), LOCAL) 
    

    replacing nnnnn with field code for Epic field.

    Valid date formats are yyyy/MM/dd and yyyy-MM-dd, or format defined at system property jira.date.time.picker.java.format.

    For example: EXP-2017/03/25. You can also define a custom date format using function: stringToDate(string s, string date_time_pattern).

  4. Nico Harold reporter

    I almost have this working except, I was trying to get it to correct a Sprint that the date was formatted as "04/05/17", is there a way to use replaceFirst(%{nnnnn}, "^\D", "") and then have it format the date as yyyy/MM/dd ? I tried using: stringToDate(replaceFirst(%{nnnnn}, "^\D", ""), "yyyy/MM/dd") and some variations of this to try and get it to format the incorrectly formatted date, but have not had any luck. Any suggestions?

  5. Fidel Castro Armario repo owner

    Hi @NFALZONE,

    JIRA Workflow Toolbox can't rename Epics. You should rename them manually. I assume that if you want to do it using the plugin, the reason is that you have a great number of Epics with that format.

    We can use an expression that can work with both date formats. It can select the format to use depending on the number of characters of the date. If the number of characters is 10, then it will use yyyy/MM/dd, otherwise it will use dd/MM/yy. The expression to use is:

    stringToDate(replaceFirst(%{nnnnn}, "^\\D*", ""), length(replaceFirst(%{nnnnn}, "^\\D*", "")) < 10 ? "dd/MM/yy" : "yyyy/MM/dd")
    

    replacing nnnnn with field code for Epic field.

  6. Fidel Castro Armario repo owner
    • changed status to open

    Hi @acelsoddbr,

    I think I can implement access to sprint's start date and end date in the next version of the plugin. Is that what you need?

  7. Antônio Duarte

    Positively, yes! We are doing a work for a big Brazilian client that has your JWT and we need that. I need to have two date custom fields in my isse: StartSprintDate and EndSprintDate that must hold respectively the Sprint Start and End dates always this issue is "dragged and dropped" to a Sprint in the JIRA Board Agile user interface. And if this same issue is moved back to the Backlog, these fields must be emptied. Can you help with this, please? The version of JWT we have in the client today is 2.2.37. When do you intend to publish the new release? Greetings.

  8. Fidel Castro Armario repo owner

    Hi @acelsoddbr,

    I have made availalble version 2.2.40_beta_1 which provides 2 new virtual fields:

    • Sprint Start Date
    • Sprint End Date

    Please, let me know whether it satisfies your needs.

  9. Antônio Duarte

    Hi, @fcarmario, It takes some bureaucracy in the IT department of my client in requesting them to install such beta versions of any product, but I will discuss this issue with them, and as soon as they approve and install it I can make the tests. I'll keep you informed. Thank you very much!

    Antonio.

  10. Antônio Duarte

    Hi, @fcarmario , I created a new custom field named 'Sprint New Start Date' based on your 'Sprint Start Date' available on 2.2.40_beta_1 and I would like to know: - Is this field automatically updated on the issues that have it on their screens? - if so, wich is the trigger that makes this update take place? Just see the example in the image below: I have lots of issues inside Sprints that fulfill the search parameter that takes into account the new field, but notice that only one issue was shown after the search. This issue was EXACTLY the only one that I opened and edited after I created your 'new' custom field. The other issues that satisfy this same search are not part of the search. BUT: as soon as I edit for the first time other issues that are in this same condition, only now they start appearing on the screen as result of this search. Another question: the 'Sprint New Start Date' custom field is not shown in any of the screens, although I had made a double check in the JIRA option 'Where is my field?' and according JIRA, the field SHOULD be visible. Thanks. Fidel 2.jpg

  11. Antônio Duarte

    Hi, @fcarmario , You are right on both your assumptions and also with the solution. Thank you very much. When do you intend to publish the oficial 2.2.40 version?

    Greetings.

  12. Log in to comment